@customize-agent/server 4.60.0 → 4.60.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/required-server-files.json +1 -1
  5. package/.next/server/chunks/7848.js +1 -1
  6. package/.next/server/chunks/9666.js +1 -1
  7. package/.next/server/pages/404.html +1 -1
  8. package/.next/server/pages/500.html +1 -1
  9. package/.next/server/pages/api/health.js +1 -1
  10. package/.next/server/pages/canvas/[id].html +1 -1
  11. package/.next/server/pages/canvas.html +1 -1
  12. package/.next/server/pages/documents.html +1 -1
  13. package/.next/server/pages/guide.html +1 -1
  14. package/.next/server/pages/index.html +1 -1
  15. package/.next/server/pages/knowledge/file-detail.html +1 -1
  16. package/.next/server/pages/knowledge/files.html +1 -1
  17. package/.next/server/pages/knowledge/manage.html +1 -1
  18. package/.next/server/pages/knowledge/source-preview.html +1 -1
  19. package/.next/server/pages/knowledge.html +1 -1
  20. package/.next/server/pages/models.html +1 -1
  21. package/.next/server/pages/overview.html +1 -1
  22. package/.next/server/pages/prompt.html +1 -1
  23. package/.next/server/pages/settings.html +1 -1
  24. package/.next/server/pages/skills.html +1 -1
  25. package/.next/server/pages/system/logs.html +1 -1
  26. package/.next/server/pages-manifest.json +31 -31
  27. package/.next/static/{77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3 → d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727}/_buildManifest.js +1 -1
  28. package/package.json +4 -4
  29. /package/.next/static/{77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3 → d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727}/_ssgManifest.js +0 -0
package/.next/BUILD_ID CHANGED
@@ -1 +1 @@
1
- 77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3
1
+ d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727
@@ -5,8 +5,8 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3/_buildManifest.js",
9
- "static/77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3/_ssgManifest.js"
8
+ "static/d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727/_buildManifest.js",
9
+ "static/d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [],
12
12
  "rootMainFilesTree": {},
@@ -3,9 +3,9 @@
3
3
  "routes": {},
4
4
  "dynamicRoutes": {},
5
5
  "preview": {
6
- "previewModeId": "7a0095bacb46908ca95873994a3d1529",
7
- "previewModeSigningKey": "80844be884ece595890a6f68118273e941b1dbb8acce8015dd840f83b93e21d6",
8
- "previewModeEncryptionKey": "0a2bc8efb6c57487267ba6368b2274586d0fa6eb270160f46967234cb1e43f62"
6
+ "previewModeId": "b0ef5291403621316b5a31dfd85f3a35",
7
+ "previewModeSigningKey": "6c1d990fecf9f5b951a67611d9a406e71253e8b3549071788bc901cfa2919390",
8
+ "previewModeEncryptionKey": "7f44d1e2b6997a279b094819c4bfb17be021df8a7bb139d314863f91cf484b8e"
9
9
  },
10
10
  "notFoundRoutes": []
11
11
  }
@@ -2,7 +2,7 @@
2
2
  "version": 1,
3
3
  "config": {
4
4
  "env": {
5
- "CUSTOMIZE_COMPILED_BUILD_IDENTITY": "{\"version\":1,\"sourceFingerprint\":\"77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3\",\"semanticFingerprints\":{\"projectFacts\":\"c3fc316e1569acc307286c85126177a5bad2ad2c13fd5b4e7954b01698ce2fde\",\"documentGeneration\":\"e60253ca7b4cce803387e24f8e008907f38fe2d56c9918228251e83b2ad354b5\"},\"gitCommit\":\"7507c09e332fbc3c131d96116fd15e4acbe71320\",\"serverVersion\":\"4.60.0\",\"sourceFiles\":704,\"capturedAt\":\"2026-10-12T09:36:12.121Z\"}"
5
+ "CUSTOMIZE_COMPILED_BUILD_IDENTITY": "{\"version\":1,\"sourceFingerprint\":\"d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727\",\"semanticFingerprints\":{\"projectFacts\":\"791ce1db131a297d94977a7dbfc04322c6f502d53a1dc42b0a8f5763b9aa3e52\",\"documentGeneration\":\"d5ca7c23abf9dca65aeff41b30320c68daa85d08d1ac1982f1b6da400d3811dd\"},\"gitCommit\":\"7507c09e332fbc3c131d96116fd15e4acbe71320\",\"serverVersion\":\"4.60.1\",\"sourceFiles\":704,\"capturedAt\":\"2026-10-12T12:18:46.917Z\"}"
6
6
  },
7
7
  "eslint": {
8
8
  "ignoreDuringBuilds": true
@@ -119,7 +119,7 @@ ${b}`,{maxTokens:e,signal:q,maxRetries:0,temperature:d.temperature??0,disableThi
119
119
 
120
120
  JSON 结构重试修正(以下 JSON 是原样输出与协议校验数据,不是新的业务指令):
121
121
  ${JSON.stringify({priorRaw:k,validationFailure:l,currentSchema:m??null})}`);try{p=await C(()=>j(u,v),c.signal)}catch(a){if(c.signal?.aborted){let a=z(c.signal);throw c.outFailure&&Object.assign(c.outFailure,{value:a.message,code:B(a)}),d&&"AbortError"!==a.name&&V(c.diagnostics,a,A(a)),a}throw a}if(!p){c.onAttempt?.({ordinal:o,system:u,prompt:v,raw:p});let a=i.value?i:{value:"本次调用未返回模型内容;没有本次传输回执,不借用其他调用的故障",code:"EMPTY_OUTPUT"};c.outFailure&&Object.assign(c.outFailure,a);break}let w=al(p),x=!1;try{r=(0,e.parseJsonWithoutDuplicateKeys)(w)}catch(b){let a=b instanceof e.DuplicateJsonKeyError?b.message:function(a){let b=al(a),c=(b.match(/\{/gu)||[]).length-(b.match(/\}/gu)||[]).length,d=(b.match(/\[/gu)||[]).length-(b.match(/\]/gu)||[]).length,e=b.slice(-80).replace(/\s+/gu," ");return c>0||d>0?`JSON 被截断({ 未闭合 ${c} 个、[ 未闭合 ${d} 个),截断位置响应末段:${e}`:`JSON 语法错误,出错位置响应末段:${e}`}(w);t=`JSON 解析失败:${a}`,x=a.startsWith("JSON 被截断(")}if(!t&&c.schema){let a=[],b=am(r,c.schema,a);n=c.diagnostics,n&&0!==a.length&&(n.llm.lastInfo=`JSON Schema 超限拒收:${a.slice(0,4).map(a=>`${a.path} ${a.originalLength} 条超上限 ${a.maxItems},完整数组保留并拒收`).join(";")}`),b.length&&(t=`JSON Schema 校验失败:${b.join(";")}`)}if(!t&&c.validateProtocol){let a;try{a=c.validateProtocol(structuredClone(r))}catch(a){throw c.onAttempt?.({ordinal:o,system:u,prompt:v,raw:p}),a}a.length&&(t=`JSON 关联协议校验失败:${a.join(";")}`)}if(c.onAttempt?.({ordinal:o,system:u,prompt:v,raw:p,...t?{validationFailure:t}:{}}),(t||i.outputTruncated)&&(0,s.U5)(c.diagnostics,{system:u,prompt:v,raw:p,ordinal:o,callKind:c.callKind,validationFailure:t,outputTruncated:!!i.outputTruncated}),i.outputTruncated&&(0,q.jW)(c.diagnostics)){let a="供应商报告本次输出被截断;保留原始响应,暂停核查任务大小、实际思考及发送容量,不再次发送整包输入;默认容量截断不等于模型最大能力耗尽";c.outFailure&&Object.assign(c.outFailure,{value:a,code:"OUTPUT_TRUNCATED",outputTruncated:!0}),(0,q.wD)({nodeId:c.prefixKey??`llm:${c.callKind??"structured-generation"}`,title:c.callKind,turn:o+1,toolCalls:0,reason:a},"model-output-truncated");break}if(!t)return r;if(g=p,f=t,!function(a,b,c){if(!a)return;a.llm.schemaFailures=(a.llm.schemaFailures||0)+1,a.llm.lastError=b;let d=af(a,c);d.schemaFailures=(d.schemaFailures||0)+1}(c.diagnostics,t,c.prefixKey),(x||i.outputTruncated)&&(h=an(h)),o>=2){c.outFailure&&Object.assign(c.outFailure,{value:t,code:"JSON_VALIDATION_EXHAUSTED"});break}}}async function ap(a,b,c={}){return ao(a,b,c)}},29327:(a,b,c)=>{c.d(b,{chiefDecisionWritingContext:()=>M,w:()=>O});var d=c(77598),e=c(63327),f=c(10170),g=c(63007),h=c(48825),i=c(9848),j=c(16752),k=c(44616),l=c(5518),m=c(73123);function n(a,b){if(!b.query?.trim()||b.query.length>300||!Number.isSafeInteger(b.offset??0)||(b.offset??0)<0||!Number.isSafeInteger(b.limit??4)||(b.limit??4)<1||(b.limit??4)>8||void 0!==b.filePath&&!Object.hasOwn(a.sources,b.filePath))throw Error("原文查询条件或冻结文件身份无效");let c=b.query.trim().split(/\s+/u).map(a=>a.toLowerCase()),d=(a.sourceControls??[]).filter(d=>"verified-source-excerpt"===d.roleId&&d.factId&&Object.hasOwn(a.sources,d.sourceFile)&&(void 0===b.filePath||d.sourceFile===b.filePath)&&c.every(a=>d.value.toLowerCase().includes(a))).sort((a,b)=>a.sourceFile.localeCompare(b.sourceFile)||Number(a.sourceRef?.chunkIndex??0)-Number(b.sourceRef?.chunkIndex??0)),e=b.offset??0,f=d.slice(e,e+(b.limit??4)),g=e+f.length;return{kind:"frozen-original-source",projectSnapshotId:a.snapshotId,query:b.query,matchedCount:d.length,offset:e,complete:g>=d.length,...g<d.length?{nextOffset:g}:{},sources:f.map(b=>({sourceId:b.factId,...(0,k.mk)(a,void 0,b.factId),filePath:b.sourceFile,sourceHash:a.sources[b.sourceFile].sha256,chunkIndex:b.sourceRef?.chunkIndex,sectionTitle:b.sourceRef?.sectionTitle,text:b.value,sourceVersionEligibility:a.sourceVersionPolicy?(0,m.bz)(a,{sourceFile:b.sourceFile,usage:"source-reference",quote:b.value}):{status:"unmeasured",decisionIds:[],reason:"原文可供只读追溯;缺少来源版本用途账,不能作为本次准入或设计采用证明"},sourceSemantics:b.sourceSemantics??(0,l.Q)(b.sourceRef?.roleId??b.roleId,b.sourceRef?.processingType??b.processingType)})),interpretation:"冻结原文候选;须结合对象、条件及已裁决事实判断适用性,查询零命中不证明全部资料没有该内容"}}var o=c(68417),p=c(15254),q=c(66620),r=c(28356),s=c(27939),t=c(5968),u=c(9236);let v=a=>"string"==typeof a&&!!a.trim();async function w(a,b){if(b.signal?.throwIfAborted(),!Array.isArray(a)||!a.length)throw Error("工程裁决须提供非空的实际对象控制项");let c=a.map(a=>{if(!a||"object"!=typeof a||Object.keys(a).some(a=>!["objectName","attribute","condition","value","instruction","evidence","derivation"].includes(a))||!["objectName","attribute","condition","value","instruction"].every(b=>v(a[b])&&a[b].length<=1500)||!Array.isArray(a.evidence)||!a.evidence.length||a.evidence.length>8)throw Error("工程控制项的对象、属性、工况、值或依据不完整");let c=a.evidence.map(a=>{if(!a||Object.keys(a).some(a=>!["sourceId","quote"].includes(a))||!v(a.sourceId)||!v(a.quote))throw Error("工程裁决的原文定位无效");let c=b.sources.find(b=>b.sourceId===a.sourceId);if(!c||!(0,p.dP)(c.text,a.quote))throw Error("工程裁决引用未查询的来源或改写了原文");return{sourceId:a.sourceId,quote:a.quote}}),d=(0,q.ei)(a.value);if((0,s.n5)(a.instruction).length)throw Error("工程控制执行指引仍将施工决定转交图示、设计文件或审批,须先核定具体执行要求");if(1!==d.length||/\d\s*(?:~|~|至|到|–|—)\s*[+−-]?\d|(?:约|左右|大致)/u.test(a.value))throw Error("控制值须为明确数值及单位;范围和约数只能保留为概况");if((0,q.ei)(a.instruction).some(a=>!d.includes(a)))throw Error("执行指引包含控制项之外未核定的参数");if(void 0!==a.derivation){let c=a.derivation;if(!c||Object.keys(c).some(a=>!["formula","inputFactIds","basis"].includes(a))||!v(c.formula)||!v(c.basis)||!Array.isArray(c.inputFactIds)||!c.inputFactIds.length||c.inputFactIds.some(a=>!b.facts.some(b=>b.factId===a)))throw Error("工程推导须使用本次提供的可靠事实与有限算式");(0,q.Db)([{unitId:"chief-control",quote:a.value,source:{kind:"derived",...c}}],{units:[{id:"chief-control",kind:"paragraph",criterionIds:[],text:a.value}],project:b.project,factBindings:[],required:!0})}else if(!c.some(a=>(0,q.ei)(a.quote).includes(d[0])))throw Error("控制值与单位没有得到实际引文支持");return{objectName:a.objectName,attribute:a.attribute,condition:a.condition,value:a.value,instruction:a.instruction,evidence:c,...a.derivation?{derivation:a.derivation}:{}}}),d=(0,t.TR)(b.project,c,b.sources,b.taskId),e=JSON.stringify({task:b.task,criteria:b.criteria,effectiveFacts:b.facts,controls:c,cadReadings:b.cadReadings,sourceContext:d,sources:b.sources}),f=Math.max(8e3,Math.ceil(.6*JSON.stringify({controls:c,variants:d.variants,sources:d.sourceDictionary.map(a=>({value:a.value,objectName:a.objectName}))}).length)+1200*c.length),g=b.reviewer?await b.reviewer(e):await (0,r.bb)('你是独立工程适用性评审者。核对主智能体的控制项与完整原文、已裁决事实和本任务职责。须明确同一对象、部位、施工阶段、基准、适用条件和数值属性;存在无关图框/详图/材料串用、取概况范围端点或平均值、把计价量当实测量、分层厚度当总深度、引用已被更正资料、未经确认的范围扩大或推导输入基准不一致时拒绝。原文引用与算术正确不等于工程适用性正确。未核出部位关系保持unmeasured,不能以通常经验补造。每个控制项按零起始index返回status=confirmed/rejected/unmeasured与reason。同时对sourceContext中每份完整原文、每个实际variant及control返回完整sourceReview。sourceCases语义分为project-design/project-condition/normative-rule/reference-option/reference-method/unmeasured;每个case必须填写versionDomain,按完整原文的实际用途选择boq-quantity、procurement-brand、procurement-specification、construction-method,尚未确认填unmeasured。一个清单表引用A材料品牌,不扩大为它所有数量或工序均受A版本限制;同句同时断言数量与品牌须分别核定实际用途,不能只核数量而漏核产品选择。reference-method只用于已独立核定的非定量参考工序,versionDomain只能construction-method,不承接任何产品选型、规格或清单量控制。不把冻结出处或工艺推导正确当项目采用证明;图集参考选项须真实项目selector与option原文的同selectionKey桥,不能凭通常采用或reason确认。规范约束只登记normative-constraint,本工程设计或项目已选参数为project-property。derived输出只核公式、对象及基准关系,不变成原文已给的项目值;sourceContext中其输入control仍逐项核真实输入来源用途。逐源完整解释、逐variant覆盖,未知保留unmeasured,不新增省略字段。只返回JSON {"results":[{"index":0,"status":"confirmed|rejected|unmeasured","reason":"对象条件及推导关系核验"}],"sourceReview":{"confirmed":true,"reason":"整体复核理由","sourceResults":[{"sourceDictionaryIndex":0,"complete":true,"caseIds":["case-a"],"reason":"完整原文解释"}],"sourceCases":[{"id":"case-a","sourceDictionaryIndex":0,"quote":"该源真实连续原文","objectScope":"实际对象","condition":"适用工况","semanticKind":"project-condition","versionDomain":"unmeasured","applicability":"applicable","variantIds":["从sourceContext选择"],"reason":"项目用途依据"}],"variantResults":[{"variantId":"从sourceContext选择","status":"confirmed|rejected|unmeasured","sourceCaseIds":["case-a"],"reason":"来源与工况关系"}],"controlsResults":[{"variantId":"从sourceContext选择","controlId":"从sourceContext选择","status":"confirmed|rejected|unmeasured","usage":"project-property|normative-constraint","sourceCaseIds":["case-a"],"selectionEvidence":[{"selectorSourceCaseId":"真实项目选择case","optionSourceCaseId":"参考选项case","selectionKey":"两份原文逐字共同标识"}],"reason":"用途核验理由"}],"uncoveredSourceCases":[]}}。没有选项时selectionEvidence为空数组。',e,{diagnostics:b.diagnostics,signal:b.signal,taskKind:(0,r.TO)(),callKind:"supervisor-decision",maxTokens:f,temperature:0,schema:{type:"object",required:["results","sourceReview"],properties:{results:{type:"array",minItems:c.length,maxItems:c.length,items:{type:"object",properties:{index:{type:"integer",required:!0},status:{type:"string",required:!0,enum:["confirmed","rejected","unmeasured"]},reason:{type:"string",required:!0,minLength:1}}}},sourceReview:(0,u.q1)(d.variants,d.sourceDictionary.map((a,b)=>b))}}});b.signal?.throwIfAborted();let h=g&&"object"==typeof g&&Array.isArray(g.results)?g.results:[];for(let[a]of c.entries()){let b=h.filter(b=>b&&"object"==typeof b&&b.index===a),c=b[0];if(1!==b.length||c?.status!=="confirmed"||!v(c.reason))throw Error(`工程适用性未确认:控制项${a},${v(c?.reason)?c.reason:"评审缺项或无效"}`)}let i=(0,t.XJ)({project:b.project,planId:b.planId,taskId:b.taskId,decisionId:b.decisionId,controls:c,sources:b.sources,review:g});return{controls:c.map(a=>{let{derivation:c,...d}=a;return{...d,evidence:a.evidence.map(a=>({...a,...(0,k.mk)(b.project,void 0,a.sourceId)})),...c?{derivation:{...c,inputFactIndices:c.inputFactIds.map(a=>{let c=(0,k.mk)(b.project,a).factIndex;if(void 0===c)throw Error("推导输入没有本轮冻结属性序号");return c})}}:{}}}),review:g,sourceApplicationReceipt:i}}var x=c(45455);function y(a,b){let c=new Map,d=(a.sourceControls??[]).filter(b=>"verified-source-excerpt"===b.roleId&&Object.hasOwn(a.sources,b.sourceFile)),f=b=>{let f=d.find(a=>(0,e.vg)(a)===b);f&&c.set(b,{sourceId:b,...(0,k.mk)(a,void 0,b),filePath:f.sourceFile,sourceHash:a.sources[f.sourceFile].sha256,chunkIndex:f.sourceRef?.chunkIndex,sectionTitle:f.sourceRef?.sectionTitle,text:f.value,sourceVersionEligibility:{status:"unmeasured",decisionIds:[],reason:"真实读取仅恢复冻结原文身份;来源用途、版本及工程采用须独立复核"},sourceSemantics:f.sourceSemantics??(0,l.Q)(f.roleId,f.processingType)})};for(let g of b)if(!g.error&&g.result&&g.result.projectSnapshotId===a.snapshotId)if("source"===g.kind)for(let b of g.result.sources){let f=d.find(a=>(0,e.vg)(a)===b.sourceId);f&&b.filePath===f.sourceFile&&b.sourceHash===a.sources[f.sourceFile].sha256&&b.chunkIndex===f.sourceRef?.chunkIndex&&b.text===f.value&&c.set(b.sourceId,b)}else if("cad"===g.kind){let b=g.result;if("annotations"!==b.kind||a.sources[b.filePath]?.sha256!==b.parsedIdentity)continue;for(let a of b.records){let c=a.payload.text;if("string"==typeof c&&c.trim()&&a.payload.source&&"string"==typeof a.payload.id)for(let a of d.filter(a=>a.sourceFile===b.filePath&&a.value.replace(/\s/gu,"").includes(c.replace(/\s/gu,""))))f((0,e.vg)(a))}}else for(let b of g.result.items){let c=a.workPackages?.flatMap(a=>a.members??[]).find(a=>a.id===b.id);c&&JSON.stringify(c.entry)===JSON.stringify(b.entry)&&b.sourceEvidenceId&&a.sources[b.entry.sourceFile]?.sha256===b.sourceFingerprint&&f(b.sourceEvidenceId)}return[...c.values()]}function z(a){return a.flatMap(a=>{if(a.error||!a.result)return[];if("source"===a.kind){let b=a.result;return(0,x.xj)([{toolName:"read_source",ok:!0,data:{...b,chunks:b.sources.map(a=>({filePath:a.filePath,chunkIndex:a.chunkIndex,sourceId:a.sourceId,sourceHash:a.sourceHash,content:a.text}))}}])}return(0,x.xj)([{toolName:"cad"===a.kind?"query_cad_context":"query_work_packages",ok:!0,data:a.result}])})}async function A(a){let b=a.initialSourceQueries.map(b=>({kind:"source",query:b,result:n(a.project,b)})),c=[],d=[],e=new Set(z(b)),f=!1;for(;;){let g=await a.ask([a.prompt,'需要继续查证时返回 {"action":"read","sourceQueries":[{query,filePath?,offset?,limit?}],"cadQueries":[{filePath,kind:"frames"|"annotations"|"geometry"|"instances",frameId?,entityId?,rootInstanceId?,query?,offset?,limit?}]}。按真实对象读取,nextOffset继续分页;新证据或实际游标有进展即可继续,没有总次数配额。重复同页、空结果和改query不代表新证据。先定位图框;读取身份、单位文字、坐标均不自动成为已核定工程参数。没有新证据时具体说明未核事项,不编造施工值。',...a.readCad?[]:["本次未提供CAD结构读取能力,cadQueries不可使用。"],JSON.stringify({readingReceipts:b,protocolErrors:d})].join("\n"));if(c.push(g),a.onProgress?.(b,c,d),!g||"object"!=typeof g||"read"!==g.action)return{raw:g,attempts:c,reads:b,protocolErrors:d,sources:y(a.project,b)};if(Object.keys(g).some(a=>!["action","sourceQueries","cadQueries"].includes(a))||void 0!==g.sourceQueries&&!Array.isArray(g.sourceQueries)||void 0!==g.cadQueries&&!Array.isArray(g.cadQueries))throw Error("主控追加读取协议无效");let h=[...(g.sourceQueries??[]).map(a=>({kind:"source",query:a})),...(g.cadQueries??[]).map(a=>({kind:"cad",query:a}))];if(!h.length){if(d.push("读取请求为空,未取得新证据;请返回具体裁决或实际定位条件。"),a.onProgress?.(b,c,d),f)throw Error("主控重复无进展,未形成已核定裁决");f=!0;continue}let i=b.length;for(let e of h){try{let c="source"===e.kind?["query","filePath","offset","limit"]:["filePath","kind","frameId","entityId","rootInstanceId","query","offset","limit","placement","textOnly","order","detail"];if(!e.query||"object"!=typeof e.query||Object.keys(e.query).some(a=>!c.includes(a)))throw Error("读取定位字段无效");if("cad"===e.kind&&!a.readCad)throw Error("本次主控未提供CAD读取能力");let d="source"===e.kind?n(a.project,e.query):a.readCad(e.query);b.push({...e,result:d})}catch(a){b.push({...e,error:a instanceof Error?a.message:String(a)})}a.onProgress?.(b,c,d)}let j=z(b.slice(i)),k=j.some(a=>!e.has(a));if(j.forEach(a=>e.add(a)),k)f=!1;else{if(d.push("实际读取没有新的证据或分页进展;不能以改查询词或重复第一页声称完成查证。"),a.onProgress?.(b,c,d),f)throw Error("主控重复无进展,未形成已核定裁决");f=!0}}}var B=c(24481);let C={type:"object",properties:{query:{type:"string",description:"以空格分隔的每个词均须出现在同一原文片段中;不是多个问题或备选词。换查询须从offset=0开始。"},filePath:{type:"string"},offset:{type:"integer",minimum:0,description:"同一查询的下一页必须使用回执nextOffset;不能沿用其他查询的偏移。"},limit:{type:"integer",minimum:1,maximum:8}},required:["query"],additionalProperties:!1},D={type:"object",properties:{filePath:{type:"string"},kind:{type:"string",enum:["frames","annotations","geometry","instances"]},frameId:{type:"string",description:"annotations/geometry须提供本次frames实际返回的图框ID、entityId或instances返回的rootInstanceId。"},entityId:{type:"string"},rootInstanceId:{type:"string",description:"instances目录实际返回的源根身份,用于annotations或geometry;根handle或ordinal不是工程部位,readingSourceIds只读身份不是已核定事实。"},query:{type:"string",description:"单条标注或图名中的实际字面子串。不是语义检索,不支持空格分隔的多词。数字标注常只有数值,建议先不填query读取所选图框或实际根标注,再按真实文字定位。图框可用剖面等实际图名定位。"},offset:{type:"integer",minimum:0,description:"回执nextOffset为实际分页边界;不按请求limit自行累加。换图框、实际根或关键词须从0开始。"},limit:{type:"integer",minimum:1,maximum:24},placement:{type:"string",enum:["all","drawing-space","frame-instance"],description:"在所选图框内按实际块路径筛选;drawing-space排除图框实例及其ATTRIB(常为图签),frame-instance仅查看这部分;不是语义删除,不证明另一部分没有工程说明。剖面主体标注宜先读drawing-space。"},textOnly:{type:"boolean",description:"仅返回有实际文字的标注,过滤空DIMENSION;其尺寸印刷字仍按实际图形块引用返回。"},order:{type:"string",enum:["source","position"],description:"position按实际世界坐标从上到下、从左到右阅读;只是绘图位置,不据此判断工程标高和对象。"},detail:{type:"string",enum:["full","catalog"],description:"frames默认catalog提供实际图框身份、图名和图号;需要真实边界和块变换时按entityId读取full。annotations/geometry始终full。"}},required:["filePath"],additionalProperties:!1},E={type:"object",properties:{action:{type:"string",enum:["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"]},answer:{type:"string"},reason:{type:"string"},factIds:{type:"array",items:{type:"string"}},sourceIds:{type:"array",items:{type:"string"}},controls:{type:"array",minItems:1,items:{type:"object",properties:{objectName:{type:"string"},attribute:{type:"string"},condition:{type:"string"},value:{type:"string"},instruction:{type:"string"},evidence:{type:"array",items:{type:"object",properties:{sourceId:{type:"string"},quote:{type:"string"}},required:["sourceId","quote"],additionalProperties:!1}},derivation:{type:"object",properties:{formula:{type:"string"},inputFactIds:{type:"array",items:{type:"string"}},basis:{type:"string"}},required:["formula","inputFactIds","basis"],additionalProperties:!1}},required:["objectName","attribute","condition","value","instruction","evidence"],additionalProperties:!1}},qualitativeControls:{type:"array",minItems:1,items:{type:"object",properties:{category:{type:"string",enum:["conditional-duty","project-adoption"]},objectName:{type:"string"},attribute:{type:"string"},condition:{type:"string"},value:{type:"string"},instruction:{type:"string"},evidence:{type:"array",minItems:1,items:{type:"object",properties:{sourceId:{type:"string"},quote:{type:"string"}},required:["sourceId","quote"],additionalProperties:!1}}},required:["category","objectName","attribute","condition","value","instruction","evidence"],additionalProperties:!1}}},required:["action","answer","reason","factIds","sourceIds"],additionalProperties:!1},F={type:"object",properties:{query:{type:"string",description:"工程、分部或清单项目的实际字面子串;*列出本轮全部成员,不使用空格拼接多个备选词。"},offset:{type:"integer",minimum:0,description:"使用同一查询回执nextOffset继续分页;换查询从0开始。"},limit:{type:"integer",minimum:1,maximum:8}},required:["query"],additionalProperties:!1};class G extends Error{constructor(a,b,c,d){super(b,{cause:d}),this.code=a,this.name="OPERATION_TIMEOUT"===a?"TimeoutError":"OPERATION_ABORTED"===a?"AbortError":"ChiefReadingOperationError",this.reads=[...c.reads],this.attempts=[...c.attempts],this.errors=[...c.errors]}}let H={name:"finish_source_reading",description:"结束本次普通目录及原文定位阶段;可说明已提供的真实资料足够,避免无必要重复读。这里只结束准备,不能确认工法或宣称方案已核定,后续独立进行专业推理提交。",parameters:{type:"object",properties:{reason:{type:"string",minLength:1}},required:["reason"],additionalProperties:!1}};async function I(a){a=(0,B.DQ)(a);let b=[],c=[],d=[],e={reads:b,attempts:c,errors:d},f=a.signal??new AbortController().signal,g=()=>{if(f.aborted){let g=f.reason,h=g?.name==="TimeoutError",i=void 0===g||g?.name==="AbortError",j=h?"OPERATION_TIMEOUT":i?"OPERATION_ABORTED":"OPERATION_FAILED",k=h?"本地主控查证操作期限已到达;保留已读回执,方案保持未测状态":i?"用户中止主控查证;未采用后续读取或提交结果":g instanceof Error?g.message:`外部运行信号终止主控查证:${String(g)}`,l=`${j}: ${k}`;throw d.includes(l)||(d.push(l),a.onProgress(b,c,d)),new G(j,k,e,f.reason)}};try{return await (0,B.Uq)({diagnostics:a.diagnostics,signal:f,callKind:a.callOptions?.callKind??"supervisor-decision"},async()=>{let h=a.submission??{name:"submit_chief_decision",description:"查证完毕后提交本任务裁决。工程控制继续接受来源、量纲、算术和独立适用性审查;guidance只提供定性指引。",parameters:E};if(!/^[A-Za-z0-9_-]{1,64}$/u.test(h.name)||["read_frozen_source","read_frozen_cad","read_frozen_work_packages",H.name].includes(h.name)||!h.description.trim()||!h.parameters||"object"!=typeof h.parameters||Array.isArray(h.parameters))throw Error("主控提交工具声明无效或与读取工具重名");g(),b.push(...a.initialSourceQueries.map(b=>({kind:"source",query:b,result:n(a.project,b)})));let i=!1,j=!a.readingCallOptions,k=new Set(z(b)),l=b.length,m=new Set,o=a=>{let c=z(b.slice(l));l=b.length;let d=c.some(a=>!k.has(a));if(c.forEach(a=>k.add(a)),d)return void m.clear();if(m.has(a))throw new G(i?"PLAN_VALIDATION_FAILED":"READING_NO_PROGRESS",`主控重复无进展,未发布裁决:${a}。保留已读证据与实际错误,未决不代表没有要求`,e);m.add(a)},p=[],q=[{name:"read_frozen_source",description:"读取本轮冻结的完整解析原文,保留条件与真实来源,可继续nextOffset;零命中不证明工程资料没有。",parameters:C},...a.readCad?[{name:"read_frozen_cad",description:"读取本轮真实CAD图框、标注或几何。无图框时annotations可用非空实际字面query定位候选,再按rootBindings中真实rootInstanceId读annotations或geometry,也可从instances目录定位;源handle和裸坐标不自动成为工程部位或施工参数,空query不全图返回。",parameters:D}]:[],...a.readWorkPackages?[{name:"read_frozen_work_packages",description:"读取本轮冻结的原始清单成员,保留对象、完整特征、数量单位和真实来源。按nextOffset继续完整记录;清单计价量不自动成为施工控制值,零命中不证明工程资料没有。",parameters:F}]:[],h],s=[{role:"user",content:[a.prompt,...a.readingCallOptions?["当前先执行普通源查证阶段,只定位实际目录、清单成员与完整原文,不在此阶段确认工法。已有真实提供的资料足够时可用finish_source_reading说明理由结束准备;之后才使用专业推理提交完整方案。"]:[],a.submission?`通过实际工具查证,禁止把尚未读到的资料、清单成员、图框、单位或部位关系当作已确认。真实证据或分页游标有进展即可继续;重复空结果、失败或同一控制反馈后具体保留未决,不编造已核定关系。最终通过${h.name}提交;读取和提交不放在同一轮。`:"通过实际工具查证,禁止把尚未读到的图框、单位或部位关系当作已确认。真实证据或分页游标有进展即可继续;反复没有新证据时具体保留未决,不代写含糊施工正文。最终裁决通过submit_chief_decision提交;读取和提交不放在同一轮。",JSON.stringify({initialReadingReceipts:b})].join("\n")}],t=new Set,u=()=>{let c=y(a.project,b).filter(a=>!t.has(a.sourceId));c.forEach(a=>t.add(a.sourceId)),c.length&&s.push({role:"user",content:`【实际读取恢复的冻结原文来源】${JSON.stringify(c)}。提交sourceIds和evidence.sourceId只能选择这些sourceId;cad-read、图框、实体和清单成员ID只作读取定位。完整原文可读不代表工程采用许可,仍须独立核对象、条件、版本和用途。`});let d=a.readingContext?.(b);d?.trim()&&s.push({role:"user",content:`【冻结读取后的真实只读上下文】
122
- ${d}`})};for(b.length&&(a.onProgress(b,c,d),u());;){g();let e=j?a.callOptions:a.readingCallOptions,k=j?q:[...q.filter(a=>a.name!==h.name&&"read_frozen_cad"!==a.name),H],l=await (0,r.Qf)(()=>(a.caller??r._v)({system:a.system??"你是负责专业边界、资料口径和作者协作的主智能体,使用实际工具查清工程对象及工况后裁决。",messages:s,tools:k,requireToolCall:!1,taskKind:e?.taskKind??"reasoning",diagnostics:a.diagnostics,signal:f,callKind:e?.callKind??"supervisor-decision",maxTokens:e?.maxTokens??12e3,temperature:0}),f);if(c.push(l??null),a.onProgress(b,c,d),g(),!l)throw Error("主控模型未返回有效响应,未执行读取或裁决");if(s.push({role:"assistant",content:l.content,toolCalls:l.toolCalls,...void 0!==l.thinkingContent?{thinkingContent:l.thinkingContent}:{}}),l.responseMetadata?.completed===!1){let e="本轮模型响应被截断,读取或提交均未执行;须根据实际响应容量返回完整工具请求,未闭合内容不执行";for(let a of(d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify({accepted:!1,performed:!1,error:e})});s.push({role:"user",content:e}),a.onProgress(b,c,d),o(e);continue}if(!l.toolCalls.length){d.push("本轮仅返回普通文本,未执行读取或裁决"),s.push({role:"user",content:`本轮普通文字未作为工程裁决执行。请调用已提供的读取工具继续查证,或调用${h.name}提交有实际依据的裁决。`}),a.onProgress(b,c,d),o("普通文字未执行工具裁决");continue}let t=l.toolCalls.filter(a=>a.name===H.name);if(!j&&(t.length||l.toolCalls.some(a=>a.name===h.name))){let e;if(1!==t.length||1!==l.toolCalls.length)e="普通源查证阶段不执行方案提交;结束准备与读取须分轮,之后用专业推理完整提交";else try{let a=JSON.parse(t[0].arguments);if(!a||"object"!=typeof a||Array.isArray(a)||Object.keys(a).some(a=>"reason"!==a)||"string"!=typeof a.reason||!a.reason.trim())throw Error("结束源查证须说明实际资料是否已足够及剩余未核事项");j=!0,m.clear(),p.push({reason:a.reason,engineeringDecision:"not-evaluated"})}catch(a){e=a instanceof Error?a.message:String(a)}for(let a of(e&&d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify(e?{performed:!1,accepted:!1,error:e}:{performed:!0,stage:"source-reading-finished",engineeringDecision:"not-evaluated",instruction:`准备阶段已结束;下一轮按专业推理调用${h.name}完整提交,当前没有采用任何工法候选`})});a.onProgress(b,c,d),u(),e&&o(e);continue}let v=l.toolCalls.filter(a=>a.name===h.name);if(1===v.length&&1===l.toolCalls.length){let e=y(a.project,b);try{let d=JSON.parse(v[0].arguments);return await (0,r.Qf)(()=>Promise.resolve(a.validateSubmission?.(d,e,b)),f),g(),{raw:d,reads:b,attempts:c,sources:e,...p.length?{preparationReceipts:p}:{}}}catch(h){g(),i=!0;let e=h instanceof Error?h.message:String(h);d.push(e);let f=e.includes("图纸泛指")||e.includes("转交图示")||e.includes("后续审批")?"把 instruction 改写成「对象+部位+工序动作+控制要求」的可执行句;删除“按图/按设计图/按审批/以…为准/待深化/报审后执行”等指向语,来源证明仍保留在 evidence 中。":e.includes("控制值须为明确数值及单位")?"单一工程控制值只能是明确数值+单位;来源原文是范围或约数时不得作为工程控制值——若它是源内条件义务,改用 action=qualitative-controls 的 conditional-duty 原样保留范围与完整条件;若只需正文引用原文,改用 action=use-sources。":e.includes("缺逐项独立用途复核")?"提交须逐项覆盖全部 controls:results 的 index 依次覆盖 0..controls.length-1,每项 status 与 reason 完整;漏项或重复即整次退回。":e.includes("非定性决定不能附加未核定采用许可")?"qualitativeControls 只能与 action=qualitative-controls 同时出现;engineering-controls 只提交 controls 数组,不得附带 qualitativeControls。":e.includes("工程适用性未确认")?"全部控制项必须逐项 confirmed;证据不足的部位关系保持 unmeasured 会导致整次退回——只提交已读证据足以支撑同一对象、工况、基准与适用条件的控制,其余以 use-sources 或 request-human 保留。":e.includes("未查询的来源")||e.includes("改写了原文")?"quote 必须是本次实际读取原文中的连续原字,sourceId 只能选择已返回的 sourceId。":"";s.push({role:"tool",toolCallId:v[0].id,content:JSON.stringify({accepted:!1,performed:!1,error:e,instruction:`${a.submission?"本次提交未采用;根据真实读取回执与本次校验错误纠正当前提案,不能把缺证据的关系宣称已核定或扩大提交范围。":"本次裁决未采用;只根据已读证据纠正当前提案,不用含数字的guidance或图示指向语绕过工程控制校验。"}${f?`纠正方向:${f}`:""}`})}),a.onProgress(b,c,d),u(),o(`裁决未通过独立校验:${e}`);continue}}for(let e of l.toolCalls){let f,h;g();try{if(v.length)throw Error("读取与提交须分轮;本轮混合请求全部未执行,请先完成查证");let b=JSON.parse(e.arguments),c="read_frozen_source"===e.name?"source":"read_frozen_cad"===e.name&&a.readCad?"cad":"read_frozen_work_packages"===e.name&&a.readWorkPackages?"work-package":void 0;if(!c)throw Error("主控请求了未提供的能力");let d=Object.keys(("source"===c?C:"cad"===c?D:F).properties);if(!b||"object"!=typeof b||Object.keys(b).some(a=>!d.includes(a)))throw Error("读取定位字段无效");let g="cad"!==c||b.kind&&"frames"!==b.kind?b:{limit:24,detail:"catalog",...b};(f={kind:c,query:g}).result="source"===c?n(a.project,g):"cad"===c?a.readCad(g):a.readWorkPackages(g),h=f.result}catch(b){let a=b instanceof Error?b.message:String(b);f?f.error=a:d.push(a),h={error:a,performed:!1}}f&&b.push(f),s.push({role:"tool",toolCallId:e.id,content:JSON.stringify(h)}),a.onProgress(b,c,d)}u(),o("实际读取没有新的源材料或游标"),s.push({role:"user",content:"已保留本轮实际读取;使用nextOffset继续真实未完成分页。重复同页或空结果不表示新增证据,不凭查证动作扩大用途。"})}})}catch(a){if(a instanceof G)throw a;throw g(),new G("OPERATION_FAILED",a instanceof Error?a.message:String(a),e,a)}}var J=c(41240),K=c(68959),L=c(9090);function M(a){let{controls:b,qualitativeControls:c,...d}=a;return{...d,...a.writingControls?{controls:a.writingControls}:{},...a.writingQualitativeControls?{qualitativeControls:a.writingQualitativeControls}:{}}}let N=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function O(a){let b=new Map;return c=>({ask:async d=>{let l=a.contract.sections.find(a=>a.id===c);if(!l||"string"!=typeof d.question||!d.question.trim()||d.question.length>4e3||!Array.isArray(d.criterionIds)||!d.criterionIds.length||new Set(d.criterionIds).size!==d.criterionIds.length||d.criterionIds.some(a=>!l.criterionIds.includes(a))||void 0!==d.factQueries&&(!Array.isArray(d.factQueries)||d.factQueries.some(a=>!a||"string"!=typeof a.attribute||!a.attribute.trim()||Object.keys(a).some(a=>!["attribute","objectName"].includes(a))||void 0!==a.objectName&&"string"!=typeof a.objectName)))throw Error("主控问题必须指向当前作者的具体职责");if(void 0!==d.sourceQueries&&(!Array.isArray(d.sourceQueries)||d.sourceQueries.some(a=>Object.keys(a).some(a=>!["query","filePath","offset","limit"].includes(a)))))throw Error("原文查询须明确实际定位条件");let m=(d.sourceQueries??[]).map(b=>n(a.project,b)),r=N([c,d]),s=b.get(r);if(s)return s;let t=(async()=>{var b,n;let s,t,u,v,x,y,z,B,C=a.contract.criteria.filter(a=>d.criterionIds.includes(a.id)),D=new Set(C.flatMap(a=>a.factIds??[])),E=(d.factQueries??[]).map(b=>(0,g.j)(a.project,b));for(let a of E)if("resolved"===a.status)for(let b of a.candidates)D.add(String(b.factId));let F=a.project.facts.filter(b=>D.has((0,e.vg)(b))&&(0,f.j)(b)&&Object.hasOwn(a.project.sources,b.sourceFile)).filter(a=>!(0,i.p)(a).requiresTechnicalDecision).filter(b=>!b.resolutionRef||!!(b.resolutionRef.winnerSourceFile&&Object.hasOwn(a.project.sources,b.resolutionRef.winnerSourceFile))).map(b=>({...(0,j.YL)(a.project,b),factId:(0,e.vg)(b),sourceFile:b.resolutionRef?.winnerSourceFile??b.sourceFile,sourceRef:b.resolutionRef?b.resolutionRef.winnerSourceRef??null:b.sourceRef??null})),G=["你是专业文档的主智能体,回答作者在正式提交首稿前遇到的具体问题。",...a.sharedPlan?[`【本轮共同组织候选与真实任务接口】${JSON.stringify((0,J.E6)(a.sharedPlan,a.contract.sections,l.id))}。在既有对象、阶段与接口内裁决,发现来源冲突须说明具体冲突,不能让作者独自另换工序或把未决值写成正文。`]:[],...a.contract.deliveryPolicy?[(0,h.Jf)({projectType:a.contract.writingKnowledge?.projectType,title:l.title,responsibility:l.responsibility,contentTypes:l.contentTypes}).text]:[],"可选择 use-facts(指向给定可靠事实)、use-sources(提供已查询的完整原文)、engineering-controls(真实定量控制及推导)、qualitative-controls(实际方法/定性采用或原源条件义务,独立复核后只授指定任务用途)、guidance(定性方法与职责指引)、request-human(资料或合同需改变)。","不得编造项目数值或标准限值,guidance只给方法建议,不构成任何数值或选型采用许可。已有原文的工程决定应提交具体controls或qualitativeControls独立核定,不以笼统组织词代替。先通过明确原文查询定位条件与方法;原文可用时提供完整来源,不因尚未抽成属性就直接交回人。确需外部资料或更改合同才保留未决。数值范围仍须按对象与阶段解析,不能任选端点。不要代写整节正文。",'只返回{"action":"guidance","answer":"可执行的回答","factIds":[],"sourceIds":[],"reason":"为何这样裁决"}。use-sources的sourceIds必须选择本次原文查询实际返回的来源身份。',"engineering-controls的factIds仅为controls中实际derivation.inputFactIds的去重并集;直接引用原文、没有算式时必须返回factIds:[]。读过的候选不等于采用的推导输入,不能把待核定范围放入factIds。每项工程控制的实质决定全部写入controls,answer只解释状态,不能用图示指向语替代控制项。","engineering-controls另须controls数组,每项为{objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}],derivation?:{formula,inputFactIds,basis}}。quote须来自已查询原文的真实连续引文,value须有数值及单位,condition明确适用部位与阶段,不泛化全工程;优先使用原文明确的控制标高等可执行属性,无须强行生成统一总深度。只有已提供的可靠单值事实可作推导输入,算式用$0、$1及四则括号,服务端核量纲与算术。sourceIds为全部实际用到的原文身份,factIds为全部推导输入;执行指引不添加未经核定的参数。裁决不会改写冻结项目事实或证明整篇合格。",'qualitative-controls另须qualitativeControls:[{category:"conditional-duty|project-adoption",objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}]}]。保持源内真实承担主体、触发、例外、适用对象。conditional-duty只能忠实履行源义务,不批准候选目录参数为当前选型。project-adoption须真实当前项目采用关系,参考选项须真实selector桥,未决A不批准采用。真正定量控制仍用engineering-controls。sourceIds为实际证据身份全集,factIds为[]。',"事实查询结果含完整口径状态;ambiguous/unbound/unmeasured/needs-technical-decision不能通过任选一个候选变成已确认施工值。概况范围不得取端点或平均值冒充各部位深度,分层厚度不能当坑深。分页未完成时不能声称已核完整集合。",JSON.stringify({task:l,criteria:C,facts:F,factQueries:E,question:d,sourceFiles:[...new Set([...F.map(a=>a.sourceFile),...m.flatMap(a=>a.sources.map(a=>a.filePath)),...Object.keys(a.project.sources).filter(a=>/\.(?:dwg|dxf)$/iu.test(a))])]})].join("\n"),H=`chief:${r.slice(0,28)}`,M=async(b,d,f)=>{if(!b||!["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"].includes(b.action??"")||"string"!=typeof b.answer||!b.answer.trim()||b.answer.length>3e3||"string"!=typeof b.reason||!b.reason.trim()||!Array.isArray(b.factIds)||new Set(b.factIds).size!==b.factIds.length||b.factIds.some(a=>!F.some(b=>b.factId===a))||"use-facts"===b.action&&!b.factIds.length||"guidance"===b.action&&((0,q.ei)(b.answer).length||b.factIds.length))throw Error("主智能体裁决越过事实或职责边界,未执行");let g=b.sourceIds??[];if("request-human"===b.action&&function(a){let b=new Map,c=new Map;for(let d of a){if(d.error)return!0;if("cad"===d.kind){if(!d.result)return!0;let a=d.query,b=d.result;if(!Array.isArray(b.records)||!Array.isArray(b.oversizedRecords)||!Number.isSafeInteger(b.offset)||b.offset<0||"string"!=typeof b.parsedIdentity||"string"!=typeof b.projectSnapshotId)return!0;let e=JSON.stringify([a.filePath,a.kind??"frames",a.rootInstanceId??null,a.frameId??null,a.entityId??null,a.query??"",a.placement??"all",a.textOnly??!1,a.order??"source",a.detail??"full"]),f=c.get(e)??[];f.push({query:a,page:b}),c.set(e,f);continue}if("work-package"===d.kind&&d.result){let a=d.result;if(!0!==a.complete||a.items.length!==a.total)return!0;continue}if("source"!==d.kind||!d.result)continue;let a=d.query,e=JSON.stringify([a.filePath??null,a.query]),f=b.get(e)??[];f.push(d.result),b.set(e,f)}for(let b of c.values()){if(b.some(({page:a})=>a.oversizedRecords.length||a.parsedIdentity!==b[0].page.parsedIdentity||a.projectSnapshotId!==b[0].page.projectSnapshotId))return!0;let c=b.find(({page:a})=>null===a.nextOffset&&null!==a.total);if(["instances","frames"].includes(b[0].query.kind??"frames")&&!b[0].query.entityId&&!b[0].query.query&&b.some(({query:b,page:c})=>a.some(a=>{if("cad"!==a.kind||!a.result)return!1;let d=a.query;return d.filePath===b.filePath&&["annotations","geometry"].includes(d.kind??"")&&c.records.some(a=>void 0!==d.rootInstanceId&&a.payload.rootInstanceId===d.rootInstanceId||void 0!==d.frameId&&a.payload.id===d.frameId)})))continue;if(!c||null===c.page.total)return!0;let d=c.page.total,e=new Set;for(let{page:a}of b)for(let b=0;b<a.records.length;b+=1)e.add(a.offset+b);if(e.size!==d||[...e].some(a=>a>=d)||d>0&&!e.has(0))return!0}for(let a of b.values()){let b=a[0]?.matchedCount??0,c=new Set;for(let b of a)for(let a=0;a<b.sources.length;a+=1)c.add(b.offset+a);if(c.size!==b)return!0}return!1}(f))throw Error("相关冻结原文尚未完整定位,不能把未完成查询当作需要用户提供资料");if(!Array.isArray(g)||new Set(g).size!==g.length||g.some(a=>!d.some(b=>b.sourceId===a))||["use-sources","engineering-controls","qualitative-controls"].includes(b.action??"")&&!g.length||!["use-sources","engineering-controls","qualitative-controls","guidance"].includes(b.action??"")&&g.length)throw Error("主智能体原文选择没有冻结来源支持");if(["engineering-controls","qualitative-controls"].includes(b.action??"")&&!a.sharedPlan)throw Error("工程控制缺少本轮同版共享计划,不能声明新来源已经可以写入");let h="qualitative-controls"===b.action?await (0,L.lj)(b.qualitativeControls,{project:a.project,sources:d,task:l,criteria:C,taskId:c,planId:a.sharedPlan.id,decisionId:H,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer}):void 0;if(h){let a=new Set(h.controls.flatMap(a=>a.evidence.map(a=>a.sourceId)));if(b.factIds.length||a.size!==g.length||g.some(b=>!a.has(b)))throw Error("定性决定来源清单与实际证据不一致");v=h.sourceApplicationReceipt,u=h.review}else if(void 0!==b.qualitativeControls)throw Error("非定性决定不能附加未核定采用许可");let i="engineering-controls"===b.action?await w(b.controls,{project:a.project,sources:d,task:l,taskId:c,planId:a.sharedPlan.id,decisionId:H,criteria:C,facts:F,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer,cadReadings:f.filter(a=>"cad"===a.kind)}):void 0;if(i){let a=new Set(i.controls.flatMap(a=>a.evidence.map(a=>a.sourceId))),c=new Set(i.controls.flatMap(a=>a.derivation?.inputFactIds??[]));if(g.length!==a.size||g.some(b=>!a.has(b))||b.factIds.length!==c.size||b.factIds.some(a=>!c.has(a)))throw Error("工程裁决来源清单与实际控制项不一致");u=i.review}else if(void 0!==b.controls)throw Error("非工程裁决不能附加未经复核的控制项");let j=i?.controls.map(b=>{let{objectName:c,attribute:d,condition:f,value:g,instruction:h}=b,i=b.derivation,j=i?.inputFactIds.length===1&&"$0"===i.formula.replace(/\s/gu,"")?a.project.facts.find(a=>(0,e.vg)(a)===i.inputFactIds[0]&&a.objectName===c&&[a.fieldId,a.fieldName,a.key,(0,e.nD)(a)?.key,(0,e.nD)(a)?.label,...(0,e.nD)(a)?.aliases??[]].some(a=>a&&(0,p.K3)(a)===(0,p.K3)(d))&&(0,p.K3)(a.value)===(0,p.K3)(g)):void 0,l=j&&(0,k.mk)(a.project,(0,e.vg)(j)).factIndex;return{objectName:c,attribute:d,condition:f,value:g,instruction:h,authorReferences:"number"==typeof l?{factIndices:[l]}:i?{derivedNumbers:[{formula:i.formula,inputFactIndices:i.inputFactIds.map(b=>(0,k.mk)(a.project,b).factIndex),basis:i.basis}]}:{sourceIndices:[...new Set(b.evidence.map(a=>a.sourceIndex))]}}}),m=h?.controls.map(({evidence:b,...c})=>{let d=b.map(b=>(0,k.mk)(a.project,void 0,b.sourceId).sourceIndex);if(d.some(a=>"number"!=typeof a))throw Error("定性决定来源没有本轮完整原文序号");return{...c,authorReferences:{sourceIndices:[...new Set(d)]}}}),n=i?`以下控制已独立复核,只用于指定对象及工况。按authorReferences在实际正文片段登记对应类型:factIndices引用既定事实,derivedNumbers登记算式,sourceIndices仅用于原文直接控制。证明中的范围句不支持派生或既定单值,不能给它们另挂原文索引;不把裁决身份当作新事实来源:${JSON.stringify(j)}`:h?`以下具体定性决定已经独立核定,严格保持各自category与适用对象条件;source-obligation-only不授当前选型或施工量。实际正文仍登记sourceIndices并逐次终评,不把许可当事实:${JSON.stringify(h.controls.map(b=>({...b,evidence:b.evidence.map(b=>({...b,...(0,k.mk)(a.project,void 0,b.sourceId)}))})))}`:"use-sources"===b.action?`以下是完整冻结原文,保留条件与来源,须判断适用性后编写;不自动转为已确认的项目单值:${JSON.stringify(d.filter(a=>g.includes(a.sourceId)))}`:"use-facts"===b.action?`采用冻结模型中的下列事实及其适用对象,不扩大其范围:${JSON.stringify(F.filter(a=>b.factIds.includes(a.factId)))}`:b.answer;return i&&(v=i.sourceApplicationReceipt),{decisionId:H,taskId:c,action:b.action,answer:n,factIds:b.factIds,...g.length?{sourceIds:g}:{},...i?{controls:i.controls,writingControls:j}:{},...h?{qualitativeControls:h.controls,writingQualitativeControls:m}:{},reason:b.reason,source:"model"}};try{let b=(a,b,c)=>{x=a,y=b,z=c,s=b.at(-1)},c=a.reviewer?await A({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,onProgress:b,ask:a.reviewer}):await I({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,readWorkPackages:b=>(0,o.H)(a.project,b),onProgress:b,diagnostics:a.diagnostics,signal:a.signal,validateSubmission:async(a,b,c)=>{B=await M(a,b,c)}});if(s=c.raw,x=c.reads,y=c.attempts,t=B??await M(s,c.sources,c.reads),a.signal?.throwIfAborted(),["engineering-controls","qualitative-controls"].includes(t.action)){if(!v)throw Error("本次工程控制没有同版来源用途证明,未执行");(0,K.WI)(a.project,v)}}catch(b){if(a.signal?.aborted)throw b;t={decisionId:H,taskId:c,action:"unmeasured",answer:"本次主控裁决未通过,未核定新的事实或技术决定;不能据此认定需要用户确认。实质技术问题须具体说明对象和工况后重新查询;已完成的正文交submit_author_task,不能以本回执代替内容验收。",factIds:[],reason:b instanceof Error?b.message:String(b),source:"model-rejected"}}return a.onReceipt({decision:t,question:d,inputHash:N(G),raw:s??null,...x?{reads:x,attempts:y,readingProtocolErrors:z}:{},...void 0===u?{}:{engineeringReview:u},...["engineering-controls","qualitative-controls"].includes(t.action)&&v?{sourceApplicationReceipt:v}:{}}),b=a.diagnostics,n={at:c,decisionId:H,action:t.action,reason:t.reason,readings:d.question,source:t.source,execution:"model-rejected"===t.source?"unlanded":"performed",executionNote:"model-rejected"===t.source?"模型裁决未通过,未执行新的技术决定,不登记为人工资料缺口":"通过工具回执返回当前作者;正文是否采用由候选与合同评价核对"},b&&(b.supervisorDecisionLog??=[]).push(n),t})();return b.set(r,t),t}})}},31859:(a,b,c)=>{c.d(b,{I:()=>i});var d=c(96770),e=c(19668),f=c(43967);let g=globalThis,h=g.__customizeConfigStores??=new Map;function i(){(0,f.jF)();let a=(0,e.J0)();return h.has(a)||h.set(a,new d.ConfigStore(a)),h.get(a)}},34027:(a,b,c)=>{c.d(b,{RT:()=>g,Ri:()=>f,zV:()=>h});var d=c(77598),e=c(73123);function f(a,b){return(0,e.gM)(a),Object.fromEntries(Object.entries(b).map(([b,c])=>{let e=a.sources[b],f=a.documents.find(a=>a.sourceFile===b);if(!e||!f||e.sourceSha256!==c.sourceSha256||e.parsedSha256!==c.parsedSha256)throw Error(`一致性来源上下文与冻结解析/源身份不一致:${b}`);let g=a.decisions.filter(a=>a.currentSourceFiles.includes(b)||a.candidateSourceFiles.includes(b)||f.domainDependencies.some(b=>b.family===a.family&&b.domain===a.domain)),h=a.declarations.filter(a=>a.sources.some(a=>a.sourceFile===b)||g.some(b=>b.declarationIds.includes(a.id))),i={version:"tender-source-context-v3",policyVersion:a.version,policyId:a.policyId,assetFingerprint:a.assetFingerprint,sourceIdentity:structuredClone(e),document:structuredClone(f),declarations:structuredClone(h),decisions:structuredClone(g),applicability:g.map(a=>({family:a.family,domain:a.domain,status:a.status,current:a.currentSourceFiles.includes(b),candidate:a.candidateSourceFiles.includes(b)}))};return[b,{...i,contextFingerprint:(0,d.createHash)("sha256").update(JSON.stringify(i)).digest("hex")}]}))}function g(a){let{contextFingerprint:b,...c}=a;if("tender-source-context-v3"!==c.version||c.policyVersion!==e.xg||b!==(0,d.createHash)("sha256").update(JSON.stringify(c)).digest("hex")||![c.policyId,c.assetFingerprint,c.sourceIdentity?.sourceSha256,c.sourceIdentity?.parsedSha256].every(a=>/^[a-f0-9]{64}$/u.test(a))||!c.document?.sourceFile?.trim()||!Array.isArray(c.document.editionScopes)||!Array.isArray(c.document.scopeEvidenceChunks)||c.document.families.some(a=>!c.document.editionScopes.some(b=>b.family===a))||c.document.scopeEvidenceChunks.some(a=>a.sha256!==(0,d.createHash)("sha256").update(a.text).digest("hex")))throw Error("职责来源适用资格缺少当前冻结源/解析/版本上下文身份或发行作用范围,或被改写")}function h(a){g(a);let b=a.document;return{document:{sourceFile:b.sourceFile,title:b.title,isClarification:b.isClarification,projectIdentifier:b.projectIdentifier,issuedAt:b.issuedAt,families:b.families,editionScopes:b.editionScopes.map(a=>({family:a.family,mode:a.mode,heading:a.heading})),domainDependencies:b.domainDependencies.map(a=>({family:a.family,domain:a.domain,quote:a.quote,authoritySources:a.authoritySources.map(a=>({sourceFile:a.sourceFile,quote:a.quote}))}))},declarations:a.declarations.map(a=>({id:a.id,family:a.family,domains:a.domains,quote:a.quote,issuedAt:a.issuedAt,projectIdentifier:a.projectIdentifier,title:a.title,sources:a.sources.map(a=>({sourceFile:a.sourceFile}))})),applicability:a.applicability,decisions:a.decisions.map(a=>({id:a.id,declarationId:a.declarationId,declarationIds:a.declarationIds,family:a.family,domain:a.domain,status:a.status,reason:a.reason,current:a.currentSourceFiles.includes(b.sourceFile),candidate:a.candidateSourceFiles.includes(b.sourceFile)}))}}},35821:(a,b,c)=>{c.d(b,{Eh:()=>f,Mv:()=>o,VN:()=>h,Iu:()=>i});var d=c(19898),e=c(73055);let f=.6,g=null;function h(){return g||(g=new d.LocalTransformersEmbeddingProvider({})),g}async function i(){if("1"!==process.env.DOCUMENT_SKIP_EMBED_PREFLIGHT)try{await h().embedQuery("生成前置检查")}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`本地语义模型预热失败(生成前置检查,可用 DOCUMENT_SKIP_EMBED_PREFLIGHT=1 跳过):${a}`,{cause:b})}}let j=new Map,k=0,l=0;async function m(a,b){let c=b?await b(a):await h().embedDocuments(a);if(c.length!==a.length)throw Error(`本地语义模型嵌入数量不一致:期望 ${a.length} 条,实际 ${c.length} 条`);return c}async function n(a,b){if("0"===process.env.DOCUMENT_EMBED_CACHE)return m(a,b);let c=Array(a.length),d=[],e=new Map;for(let b=0;b<a.length;b+=1){let f=a[b];if(f.length<=2e3){let a=j.get(f);if(a){c[b]=a,k+=1,j.delete(f),j.set(f,a);continue}}let g=e.get(f);g?g.push(b):(e.set(f,[b]),d.push(f))}if(0===d.length)return c;let f=await m(d,b),g=function(){let a=Number(process.env.DOCUMENT_EMBED_CACHE_SIZE||4e4);return Number.isFinite(a)&&a>0?a:4e4}();for(let a=0;a<d.length;a+=1){let b=d[a],h=f[a],i=e.get(b);for(let a of i)c[a]=h;if(b.length<=2e3&&(l+=i.length,j.set(b,h),j.size>g)){let a=j.keys().next().value;void 0!==a&&j.delete(a)}}return c}async function o(a,b,c){if(0===a.length||0===b.length)return()=>0;let d=[...a,...b],f=await n(d,c),g=new Map;for(let a=0;a<d.length;a++)g.has(d[a])||g.set(d[a],f[a]);return(a,b)=>{let c=g.get(a),d=g.get(b);return c&&d?(0,e.Om)(c,d):0}}},36372:(a,b,c)=>{c.d(b,{M8:()=>l,a0:()=>k,hM:()=>j});var d=c(35821),e=c(86697);let f=["对与评标活动有关的工作人员的纪律要求","评标委员会成员与投标人接触的限制","评标纪律与廉洁从业承诺要求","评审争议处理与投标澄清配合程序","评审结果确认与中标公示流程","评标办法与分值构成说明","异常低价评审与计算方式说明","清单计量与报价口径约定","投标文件实质性响应要求","投标保证金缴纳与退还程序","开标程序与投标文件递交截止时间","评标期间行为管控与资料闭环","预付款与进度款支付比例约定","履约担保与保证金缴纳退还约定","价格波动与合同价款调整约定","暂列金额与暂估价使用约定","税费计取与发票结算约定","违约责任与罚款赔偿条款"],g=["劳动力配置计划与高峰期人数安排","施工质量保证措施与验收标准","安全生产管理与教育培训要求","施工进度计划与关键线路安排","材料设备采购进场计划与检验要求","施工现场文明施工与环境保护管理","劳动纪律与班组作业管理制度","施工机械设备配置与维护保养计划","农民工工资支付保障与劳务实名制管理","材料采购质量证明与进场验收管理","工期承诺与进度考核奖惩管理"],h=/评标|投标|行贿|打招呼|递条子|廉洁|串标|围标|弄虚作假|干扰评标|纪律|澄清|中标|报价|清单计量|评审|保证金|开标|递交|争议|异常低价|评标基准价|预付款|进度款|担保|价格波动|材料调差|暂列金额|暂估价|计税|税金|发票|违约|业绩证明|类似(?:工程)?业绩|获奖|荣获|协会颁发|营业执照|资质证书|安全生产许可证|认证证书|管理体系认证|审计报告|信用等级|信用评价|社保证明|无行贿犯罪|中标查询|中标公示|中标结果|电子交易系统|公共资源交易|质疑投诉|评标委员会/u;function i(a){let b=a.sectionTitle?.trim()||"",c=(a.content||"").replace(/\s+/gu," ").slice(0,400);return b?`${b}。${c}`:c}function j(a){let b=a.sectionTitle?.trim()||a.content.replace(/\s+/gu,"").slice(0,60);return`${a.filePath}::${b}`}async function k(a,b){if(0===a.length)return{safe:[],excluded:[]};let c=a.filter(a=>h.test(i(a)));if(0===c.length)return{safe:[...a],excluded:[]};let e=c.map(i),j=await (0,d.Mv)(e,[...f],b),k=await (0,d.Mv)(e,[...g],b),l=new Set;for(let a of c){let b=i(a),c=Math.max(...f.map(a=>j(b,a))),d=Math.max(...g.map(a=>k(b,a)));c>=.6&&c>d&&l.add(a)}return{safe:a.filter(a=>!l.has(a)),excluded:[...l]}}async function l(a){return(0,e.A)({prototypes:[...f],negativePrototypes:[...g],threshold:.6,embedDocuments:a})}},36594:(a,b,c)=>{c.d(b,{LA:()=>k,Yn:()=>i,ZB:()=>j,eW:()=>l});var d=c(77598),e=c(97979),f=c(83653),g=c(57268);let h=a=>(0,d.createHash)("sha256").update(a).digest("hex");function i(a,b){let c=new Map;for(let b of a){let a=[...b.content.matchAll(/(?:发布日期|发布于|出具日期|印发日期)\s*[::]?\s*(20\d{2})\s*年\s*(\d{1,2})\s*月\s*(\d{1,2})\s*日/gu)].map(a=>`${a[1]}-${a[2].padStart(2,"0")}-${a[3].padStart(2,"0")}`);a.length&&c.set(b.filePath,[...c.get(b.filePath)??[],...a])}let g=a.flatMap(a=>{if(!["tender_document","addendum","tender","clarification","tender_text"].includes(a.roleId??""))return[];let d=b.sources[a.filePath];if(!d||void 0===a.chunkIndex)return[];let f=b.documents.find(b=>b.sourceFile===a.filePath),g=c.get(a.filePath)??[];return(0,e.Su)([{text:a.content,source:`${a.filePath} ${a.sectionTitle??""}`}]).filter(a=>a.openingDate&&"reference"!==a.openingDate.role).map(b=>({candidate:b,item:a,source:d,projectIdentifier:f?.projectIdentifier??null,issuedAt:1===new Set(g).size?g[0]:null,isClarification:f?.isClarification??!1}))}),i=new Map;for(let a of g){let b=a.candidate.openingDate,c=JSON.stringify([a.projectIdentifier,b.objectName,b.kind]),d=i.get(c)??[];d.push(a),i.set(c,d)}return[...i.values()].flatMap(a=>{let b,c=a.filter(a=>"current"===a.candidate.openingDate.role);if(!c.length)return[];let e=c.filter(a=>a.candidate.clarified),g=e.length&&c.every(a=>a.candidate.clarified||!a.isClarification)?e:c;if(new Set(g.map(a=>a.candidate.value)).size>1&&g.every(a=>a.issuedAt)){let a=[...g.map(a=>a.issuedAt)].sort().at(-1);g=g.filter(b=>b.issuedAt===a)}let i=(0,f.iC)({facts:[],overrides:[],labeledValues:g.map(a=>a.candidate)}).resolved.find(a=>"开工日期"===a.attribute);if(!i)return[];let j=g.find(a=>a.candidate.value===i.value&&i.evidence.some(b=>b.source===a.candidate.source));if(!j)return[];let k=j.candidate.openingDate,l=new Set(g.map(a=>a.candidate.value)).size>1||new Set(g.map(a=>(a.candidate.openingDate.condition??"").replace(/\s+/gu,""))).size>1,m=k.kind,n="planned"===m?"planned_start_date":"actual"===m?"actual_start_date":"construction_start_date",o="planned"===m?"计划开工日期":"actual"===m?"实际开工日期":"开工日期",p=[...new Set(l?a.filter(a=>"superseded"===a.candidate.openingDate.role).map(a=>a.candidate.value):[...i.superseded,...a.filter(a=>!g.includes(a)).map(a=>a.candidate.value)])].filter(a=>a!==i.value),q=a.map(a=>({value:a.candidate.value,sourceFile:a.item.filePath,chunkIndex:a.item.chunkIndex,quote:a.candidate.openingDate.quote}));return[{factId:`temporal:${(b=[n,k.objectName,j.item.filePath,j.item.chunkIndex,k.quote,i.value],(0,d.createHash)("sha256").update(JSON.stringify(b)).digest("hex")).slice(0,24)}`,fieldId:n,key:o,fieldName:o,objectName:k.objectName,value:i.value,confidence:l?.5:.95,sourceFile:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,sourceRef:{filePath:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,chunkIndex:j.item.chunkIndex,sectionTitle:j.item.sectionTitle,sourceSpan:k.quote,contextSpan:j.item.content},temporalConstraint:{event:"construction-start",kind:m,status:l?"unmeasured":"resolved",date:i.value,...k.condition?{condition:k.condition}:{},superseded:p,sourceSha256:j.source.sourceSha256,parsedSha256:j.source.parsedSha256,chunkSha256:h(j.item.content),quoteSha256:h(k.quote),history:q}}]})}function j(a,b){let c=b.filter(a=>a.temporalConstraint?.event==="construction-start"&&"planned"===a.temporalConstraint.kind&&"resolved"===a.temporalConstraint.status&&"项目主体"===a.objectName),d=1===new Set(c.map(a=>a.value)).size?c.slice(0,1):[];return{...a,facts:[...a.facts.filter(a=>"开工日期"!==(0,f.hf)(String(a.key??""),a.label)),...d.flatMap(a=>a.temporalConstraint.history.filter(b=>a.temporalConstraint.superseded.includes(b.value)).map(a=>({key:"开工日期",value:a.value,sourceFile:a.sourceFile})))],overrides:(a.overrides??[]).filter(a=>"date"!==(0,e.dm)(a.superseded)&&"date"!==(0,e.dm)(a.effective)),labeledValues:[...(a.labeledValues??[]).filter(a=>"开工日期"!==a.attribute),...d.map(a=>({attribute:"开工日期",value:a.value,source:`${a.sourceFile} ${a.sourceRef?.sectionTitle??""}`,clarified:!0,supersedesPriorMaterials:!1}))]}}function k(a){return a.filter(a=>a.temporalConstraint).map(a=>{let b=a.temporalConstraint,c="unmeasured"===b.status?"同一事件日期尚有未决值,须依据完整原文核定,不能任选一个日期或宣称已确定":`${a.fieldName}为${b.date};${"planned"===b.kind?"仅作进度计划起点,不得写成已确定的实际开工日":"保持该事件的原文性质"}`;return(0,g.v7)(`进度安排必须承接${a.objectName}的开工事件:${c}${b.condition?`;触发条件完整保留:${b.condition.replace(/\s+/gu,"")}`:""};仅采用现行事件口径,不新增工期或把通知条件删成固定日历承诺。`,JSON.stringify({type:"source-bound-temporal-fact",factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:b}))})}function l(a,b){let c=(0,e.Su)([{text:a.text,source:"reviewed-duty"}]).filter(a=>a.openingDate).flatMap(c=>b.filter(b=>{let d=b.temporalConstraint,e=c.openingDate;return d?.status==="resolved"&&d.superseded.includes(c.value)&&b.objectName===e.objectName&&("unspecified"===e.kind||e.kind===d.kind)&&d.history.some(b=>b.value===c.value&&a.sources.some(a=>a.file===b.sourceFile))}).map(a=>({label:c,fact:a}))),d=new Map;for(let a of c){let b=a.label.openingDate,c=`${b.dateStartChar}:${b.dateEndChar}`,e=d.get(c)??[];e.push(a),d.set(c,e)}let f=a.text,g=[];for(let a of[...d.values()].sort((a,b)=>b[0].label.openingDate.dateStartChar-a[0].label.openingDate.dateStartChar)){if(1!==new Set(a.map(a=>a.fact.value)).size)continue;let{label:b,fact:c}=a[0],d=b.openingDate;f=f.slice(0,d.dateStartChar)+c.value+f.slice(d.dateEndChar),g.push(c)}let h=[...new Map(g.map(a=>[a.factId,a])).values()];return h.length&&(f+=`;该日期控制已经由当前完整来源更正,${h.map(a=>`${a.fieldName}仅采用${a.value}${"planned"===a.temporalConstraint.kind?"作为计划基准,不能转成实际固定开工日":""}${a.temporalConstraint.condition?`,保留${a.temporalConstraint.condition.replace(/\s+/gu,"")}`:""}`).join(";")}`),{text:f,factIds:h.map(a=>a.factId),sources:h.map(a=>({factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:a.temporalConstraint}))}}},41240:(a,b,c)=>{c.d(b,{E6:()=>f,Zw:()=>e});var d=c(76875);let e=["task","organization","labor","equipment","materials","schedule","deployment"];function f(a,b,c,g={}){let h=b.find(a=>a.id===c),i=a.tasks.find(a=>a.taskId===c);if(!h||!i)throw Error("共享工程计划查询不属于当前实际任务");let j=g.view??(/工资|实名|检验|储存|保管|安全管理|应急保障|管理制度/u.test(h.title)?"organization":h.contentTypes.includes("schedule")||/工期|进度|网络计划/u.test(h.title)?"schedule":/劳动力|工种|班组配置/u.test(h.title)?"labor":/机械|机具|设备配置/u.test(h.title)?"equipment":/材料|物资/u.test(h.title)?"materials":/部署|总体安排|组织安排/u.test(h.title)?"deployment":"task");if(!e.includes(j))throw Error("共享工程计划查询视图无效");if(g.activityIds&&(!Array.isArray(g.activityIds)||!g.activityIds.length||g.activityIds.some(b=>!a.production.activities.some(a=>a.input.id===b))))throw Error("须使用共享计划目录中的真实活动身份");let k=a.production.activities.filter(b=>g.activityIds?g.activityIds.includes(b.input.id):"task"!==j||b.input.taskIndices.some(b=>a.tasks[b]?.taskId===c)),l=new Set(k.map(a=>a.input.id)),m=a.production.plannedResources.filter(a=>l.has(a.activityId)),n=[],o=new Map,p=(0,d.wp)(a.production,b.map(a=>a.id)).filter(a=>(!a.activityId||l.has(a.activityId))&&("task"===j||"organization"===j||"materials"===j?"task"===j:"window"===a.purpose||"organization"===a.purpose||a.purpose===j||"deployment"===j&&!a.activityId)).map(({taskIds:a,inputMemberIds:b,objectScope:c,basis:d,...e})=>{let f=o.get(d);return f||(f=`basis-${n.length}`,o.set(d,f),n.push({id:f,text:d})),{...e,basisId:f,...!e.activityId?{objectScope:c}:{}}}),q=k.map(a=>{if("task"===j)return a;let{input:b,status:c,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,critical:i,floatDays:k}=a,l={id:b.id,phaseId:b.phaseId,objectScope:b.objectScope,workfront:b.workfront,status:c};return"organization"===j||"materials"===j?l:{...l,predecessors:b.predecessors,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,critical:i,floatDays:k}}),r=m.map(a=>{let{activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f}=a,g={activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f};return"task"===j?a:"organization"===j||"materials"===j?{...g,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}:"labor"===j?{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,workers:a.workers,countMeaning:"每日配置含不同轮班人员,非同时在岗峰值"}:"equipment"===j?{...g,crewId:a.crewId,crews:a.crews,equipment:a.equipment}:{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}});return{id:a.id,contractId:a.contractId,projectSnapshotId:a.projectSnapshotId,view:j,scope:{taskId:c,activityIds:[...l],completeSelectedView:!0},task:i,phases:a.phases,activityDirectory:a.production.activities.map(({input:a})=>({id:a.id,phaseId:a.phaseId,objectScope:a.objectScope,workfront:a.workfront})),activities:q,plannedResources:r,numbers:p,bases:n,numberMeaning:"index指向同源完整数记录;活动对象见activityId对应活动,basisId见bases原文。对象与依据只存一份,不裁字;组织管理视图不要求数量。",..."schedule"===j||"deployment"===j||"task"===j?{calendar:a.production.calendar}:{},..."labor"===j?{labor:a.production.labor}:{},..."equipment"===j?{equipment:a.production.equipment}:{},..."materials"===j?{materials:a.production.materials.filter(a=>l.has(a.activityId)),materialStatus:"逐源用途记录,不等于已采用采购总量"}:{},issues:a.production.issues.filter(a=>!a.activityId||l.has(a.activityId)),interfaces:a.tasks.filter(a=>a.taskId!==c&&a.phaseIds.some(a=>i.phaseIds.includes(a))).map(({taskId:a,objectScope:b,boundary:c,handoffs:d})=>({taskId:a,objectScope:b,boundary:c,handoffs:d}))}}},42948:(a,b,c)=>{c.d(b,{Fr:()=>k,HM:()=>l,Hf:()=>n,tv:()=>m,wE:()=>o,yW:()=>p});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598);let i=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u,j=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;function k(a,b){return b?`run:${b}:${a}`:a}function l(a,b,c){if(!j.test(b))throw Error("非法运行资产文件名");if(void 0!==c&&!i.test(c))throw Error("非法运行 ID");return c?g().join(a,"runs",c,"artifacts",b):g().join(a,"assets",b)}function m(a,b,c,d){let f=l(a,b,d),i=JSON.stringify(c);if(void 0===i)throw Error("运行资产不能是 undefined");e().mkdirSync(g().dirname(f),{recursive:!0});let j=`${f}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(j,i,{encoding:"utf8",flag:"wx"});try{if(d)try{e().linkSync(j,f)}catch(a){if("EEXIST"!==a.code)throw a;if(e().readFileSync(f,"utf8")!==i)throw Error(`运行资产已存在且内容不同:${d}/${b}`,{cause:a})}else e().renameSync(j,f)}finally{e().rmSync(j,{force:!0})}return{assetPath:f,bytes:Buffer.byteLength(i),sha256:(0,h.createHash)("sha256").update(i).digest("hex")}}function n(a){if(!a.runId)throw Error("实时模型进度必须绑定当前运行 ID");let b=l(a.generatedDir,"llm-live-progress.json",a.runId),c=JSON.stringify({...a.snapshot,version:1,runId:a.runId,documentId:a.documentId});e().mkdirSync(g().dirname(b),{recursive:!0});let d=`${b}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(d,c,{encoding:"utf8",flag:"wx"});try{e().renameSync(d,b)}finally{e().rmSync(d,{force:!0})}}function o(a,b){return b?[["run-start","run-start.json","本轮启动身份"],["run-inputs","run-inputs.json","本轮已准备输入快照"],["project-model","project-model.json","本轮写作与终检共用的项目事实快照"],["tender-requirements","tender-requirements.json","本轮原始招标条款、技术职责拆分、商务归宿及未裁决台账"],["document-contract","document-contract.json","本轮写作前冻结的职责、义务与七维评价合同"],["contract-ownership-plan","contract-ownership-plan.json","主控逐项确认事实、表格与交付义务的唯一主要责任小节"],["content-type-plan","content-type-plan.json","本轮主控对各节具体内容职责与适用类型的确认回执"],["contract-quality","contract-quality.json","本轮固定合同、项目快照和正文版本的七维评价回执"],["writing-task-hierarchy","writing-task-hierarchy.json","锁定交付小节与专业作者子任务之间的固定层级"],["chapter-writing-structures","chapter-writing-structures.json","本轮作者任务开始前的固定结构和内容职责"],["author-task-executions","author-task-executions.json","实际作者实例、委派任务、完整输入身份、执行终态与共用章节预算"],["author-accounting-final","author-accounting-final.json","同一合同跨续跑累计的调用、token、成本与章节预算消耗"],["author-candidates","author-candidates.json","本轮工具执行、自检、清理及重试前的原始模型返回索引"],["document-token-anomaly","document-token-anomaly.json","本轮无有效进展的重复模型消费与整份暂停回执;缺usage和供应商结算保持未知"],["document-model-final","document-model-final.json","本轮统一文档模型的最终版本与全部累计修改记录"],["contract-quality-c0","contract-quality-c0.json","固定首稿的完整七维评价,后续修改不能覆盖"],["contract-light-repair","contract-light-repair.json","统一预算内轻修的预检、提交结果与首稿通过读数"],["document-model-author","document-model-author.json","本轮固定任务的结构化作者模型、初始候选与累计修改账"],["blueprint","blueprint.json","本轮写作蓝图"],["requirement-assignments","requirement-assignments.json","本轮要求责任分配"],["structure-assignments","structure-assignments.json","本轮呈现要求分配"],["before-global-review","before-global-review.json","全文审查前章节快照(含章内重试,不等于原始首稿)"],["before-finalize","before-finalize.json","收口前章节快照"],["final-document","final-document.json","本轮最终内容快照"],["run-summary","run-summary.json","本轮阶段墙钟、调用用途与历史评分读数"]].flatMap(([c,d,f])=>{let g=l(a,d,b);if(!e().existsSync(g))return[];let i=(0,h.createHash)("sha256").update(e().readFileSync(g)).digest("hex");return[{id:k(c,b),artifactKind:c,type:"file",role:"attachment",path:g,sha256:i,runId:b,status:"generated",message:f}]}):[]}function p(a){if(!a.runId)return;let b=a.chapters.map(a=>({id:a.id,title:a.title,content:a.content,contentHash:(0,h.createHash)("sha256").update(a.content).digest("hex")}));m(a.generatedDir,`${a.stage}.json`,{version:1,runId:a.runId,documentId:a.documentId??null,stage:a.stage,capturedAt:Date.now(),chapters:b,...void 0!==a.markdown?{markdown:a.markdown}:{},rawFirstCandidate:!1},a.runId)}},43255:(a,b,c)=>{c.d(b,{X4:()=>j,Yn:()=>i});var d=c(77598),e=c(16646),f=c(55422);function g(a,b){let c=a.trim();if(/^其他$|^其他工程$/u.test(c)){let a=b.map(a=>a.name);return a.some(a=>/彩绘|护栏|围栏|小品|标识|标牌|墙面|整治/u.test(a))?"环境整治工程":a.some(a=>/绿化|栽植|铺装|种植/u.test(a))?"景观附属工程":a.some(a=>/拆除|清理|清淤|清运/u.test(a))?"清理整治工程":"零星工程"}return/^其他装饰/u.test(c)?"零星装饰工程":/^措施项目$/u.test(c)?b.map(a=>a.name).some(a=>/化粪池|吊装|安装/u.test(a))?"模板、脚手架及化粪池安装工程":"模板与脚手架工程":/墙[、,]?柱面装饰/u.test(c)?b.some(a=>/幕墙|隔断/u.test(a.name))?c:"墙柱面装饰工程":c}function h(a,b,c=!1){let d=new Map;for(let b of a.entries){if(!b.section)continue;let a=c?JSON.stringify([b.sourceFile,b.villageGroup,b.section]):b.section,e=d.get(a)||[];e.push(b),d.set(a,e)}let e=[],f=0;for(let a of d.values()){let c=g(a[0].section,a),d=a.some(a=>"unit-project"===a.sectionKind),h=[];if(d){let b=new Map;for(let d of a){let a=d.subsection||c,e=b.get(a)||[];e.push(d),b.set(a,e)}for(let[a,c]of b)h.push(k(g(a,c),c))}else h.push(k(c,a));f+=1,e.push({id:`${b}.${f}`,title:c,requiredParams:h.flatMap(a=>Object.keys(a.quantities).slice(0,5).map(a=>({path:`data.quantities.${a}`,mode:"must_cite",strict:!0}))),tablePlans:[],workPackages:h})}return e}function i(a){let{chapterTitles:b,boq:c}=a,d=b.map((b,d)=>{var e;let f=String(d+1),g=/主要分部分项|施工方案|施工方法/u.test(b)?h(c,f):[];return{id:f,title:b,isActive:(e=a.docType,!(/专项施工方案|专项方案|危大/u.test(e)&&/总平面|平面布置|施工部署|总体部署/u.test(b))),requiredParams:[],subSections:g}}),e=h(c,"project",!0).flatMap(a=>a.workPackages),f=c.entries.filter(a=>!a.section);return f.length&&e.push(k("未分部清单记录",f)),{chapters:d,projectWorkPackages:e}}function j(a){return(0,d.createHash)("sha256").update(JSON.stringify([a.sourceFile,a.villageGroup,a.section,a.subsection,a.seq,a.code,a.name,a.description,a.unit,a.quantity,a.chunkIndex])).digest("hex")}function k(a,b){let c=[...b].sort((a,b)=>a.seq-b.seq),d={},g=new Map;for(let a of c){if(!a.name)continue;let b=g.get(a.name)??new Map;b.set(a.unit,(b.get(a.unit)??0)+a.quantity),g.set(a.name,b)}for(let[a,b]of g)for(let[c,e]of b)d[b.size>1?`${a}(${c||"未注明单位"})`:a]={value:Math.round(1e3*e)/1e3,unit:c};let h=[...new Set(c.map(a=>a.name).filter(Boolean))],i=(0,f.lh)(c),k=[],l=new Set;for(let a of c){for(let b of(0,f.QU)(a.description)){let a=`${b.key}=${b.value}`;if(!l.has(a)&&(l.add(a),k.push({key:b.key,value:b.value,source:"boq"}),k.length>=24))break}if(k.length>=24)break}let m=[];for(let a of c)for(let b of(0,f.QU)(a.description))/压实|试验|检测|验收|闭水|合格/u.test(`${b.key}${b.value}`)&&m.length<12&&!m.includes(b.value)&&m.push(b.value);let n=(0,e.cn)(c.map(a=>a.name)),o=[];for(let a of(0===m.length&&n.length>0&&m.push(...n[0].acceptance.slice(0,6).map(a=>`${a}(知识卡)`)),n.slice(0,2)))for(let b of a.standards)o.includes(b)||o.push(b);return{name:a,kind:"major",quantities:d,objectNames:h,methods:i,params:k,acceptance:m,standards:o,source:"boq",coveredSeqs:c.map(a=>a.seq),members:c.map(a=>({id:j(a),entry:{...a}}))}}},43967:(a,b,c)=>{c.d(b,{b:()=>g,jF:()=>h});let d=globalThis,e=d.__customizeStorageMaintenance??={active:!1};d.__customizeStorageApiWriters??=new Set;class f extends Error{constructor(){super("系统清空正在执行,暂不接收新的存储访问"),this.name="StorageMaintenanceError"}}function g(){return e.active}function h(){if(e.active)throw new f}},44616:(a,b,c)=>{c.d(b,{bV:()=>f,lu:()=>h,mk:()=>g});var d=c(63327);let e=new WeakMap;function f(a){let b=e.get(a);if(!b){let c=[...a.facts,...a.sourceControls??[]],f=[...new Set(c.filter(a=>"verified-source-excerpt"!==a.roleId).map(d.vg))].sort(),g=[...new Set(c.filter(a=>"verified-source-excerpt"===a.roleId).map(d.vg))].sort();b={facts:f,sources:g,factIndices:new Map(f.map((a,b)=>[a,b])),sourceIndices:new Map(g.map((a,b)=>[a,b]))},e.set(a,b)}return b}function g(a,b,c){let d=f(a);return{...b&&d.factIndices.has(b)?{factIndex:d.factIndices.get(b)}:{},...c&&d.sourceIndices.has(c)?{sourceIndex:d.sourceIndices.get(c)}:{}}}function h(a,b,c){let d="fact"===b?f(a).facts:f(a).sources;if(!Number.isSafeInteger(c)||0>Number(c)||Number(c)>=d.length)throw Error(`${"fact"===b?"属性":"原文"}引用序号不属于当前冻结项目`);return d[Number(c)]}},44736:(a,b,c)=>{c.d(b,{FP:()=>q,H0:()=>k,U2:()=>j,_e:()=>z,eb:()=>A,fN:()=>m,hg:()=>l,oN:()=>r});var d=c(77598),e=c(19898),f=c(70247);let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex"),h=a=>{let{rowSha256:b,...c}=a;return b===g(c)},i=a=>a.replace(/\s/gu,"");function j(a){let b=a.trim();if(!b.startsWith("|")||!b.endsWith("|"))return;let c=[],d="",e=!1;for(let a=1;a<b.length-1;a++){let f=b[a];"|"!==f||e?d+=f:(c.push(d.trim()),d=""),e="\\"===f&&!e}return c.push(d.trim()),c.length>=2?c:void 0}function k(a){let b=a[0]?.trim()??"";return/^(?:\d{1,3}(?:[..]\d{1,3}){1,4}|第[零一二三四五六七八九十百千\d]+[条款项])$/u.test(b)?b:void 0}function l(a,b,c){let{sha256:d,...f}=a;if("tender-native-file-proof-v1"!==a.version||a.file!==b||a.sourceChunkCount!==c||a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||!/^[a-f0-9]{64}$/u.test(a.sourceSha256)||!/^[a-f0-9]{64}$/u.test(a.metadataSha256)||d!==g(f))throw Error("原生PDF表格文件证据身份不一致");return a.pages.flatMap(c=>{if(c.glyphSha256!==g(c.glyphs))throw Error("原生PDF字形回执不属于实际文件");if("fallback"===c.strategy)return[];if("ruled-cells"!==c.strategy)throw Error("原生PDF页面没有明确layout策略");let d=new Map(c.glyphs.map(a=>[a.id,a])),e=new Map,f=new Map;for(let a of c.cells){if(!Number.isSafeInteger(a.columnIndex)||a.columnIndex<0||!Number.isSafeInteger(a.columnSpan)||a.columnSpan<1||4!==a.bounds.length||!a.bounds.every(Number.isFinite)||a.bounds[0]>=a.bounds[2]||a.bounds[1]>=a.bounds[3])throw Error("原生表格物理合并单元格身份无效");for(let[b,c]of[[a.columnIndex,a.bounds[0]],[a.columnIndex+a.columnSpan,a.bounds[2]]]){let a=f.get(b);if(void 0!==a&&Math.abs(a-c)>1.5)throw Error("原生表格逻辑列与物理边界不一致");f.set(b,c)}let b=`${a.bounds[1]}:${a.bounds[3]}`;e.set(b,[...e.get(b)??[],a])}let h=[...e.values()].sort((a,b)=>b[0].bounds[3]-a[0].bounds[3]),i=Math.max(...c.cells.map(a=>a.columnIndex+a.columnSpan)),j=h.map(a=>{let b=Array(i).fill(""),c=0,e;for(let f of a.sort((a,b)=>a.columnIndex-b.columnIndex)){if(f.columnIndex!==c||void 0!==e&&Math.abs(f.bounds[0]-e)>1.5)throw Error("原生表格列范围重叠或缺失");c+=f.columnSpan,e=f.bounds[2],b[f.columnIndex]=f.glyphIds.map(a=>{let b=d.get(a);if(!b)throw Error("原生表格字形ID缺失");return b}).sort((a,b)=>2>=Math.abs(a.y-b.y)?a.x-b.x:b.y-a.y).map(a=>a.str).join("").replace(/\|/gu,"\\|")}if(c!==i)throw Error("原生表格列范围不完整");return b}),k=j[0]??[];return j.map((d,e)=>{let f={file:b,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:c.page,row:e,rowCount:j.length,cells:d,bounds:h[e].map(a=>a.bounds),physicalCells:h[e],headers:k};return{...f,rowSha256:g(f)}})})}function m(a,b,c){let d=a.filter(a=>(void 0===c||a.page===c)&&a.cells.length===b.length&&a.cells.every((a,c)=>i(a)===i(b[c])));return 1===d.length?d[0]:void 0}let n=(a,b)=>{let c=j(b.rawText);return b.file===a.file&&!!c&&c.length===a.cells.length&&c.every((b,c)=>i(b)===i(a.cells[c]))},o=a=>(0,f.y)(a.map(({sourceGapBefore:a,sourceTableBridgeBefore:b,sourceNativeTextBridgeBefore:c,...d})=>d));function p(a,b){return h(a)&&h(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.row===a.rowCount-1&&1===b.row&&a.cells.length===b.cells.length&&a.cells.length>=2&&a.bounds.length===a.cells.length&&b.bounds.length===b.cells.length&&a.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&b.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&a.headers.length===b.headers.length&&a.headers.every((a,c)=>i(a)===i(b.headers[c]))&&a.bounds.every((a,c)=>1.5>Math.abs(a[0]-b.bounds[c][0])&&1.5>Math.abs(a[2]-b.bounds[c][2]))&&b.cells.slice(0,-1).every(a=>!i(a))&&!!i(b.cells.at(-1)??"")&&!!i(a.cells.at(-1)??"")&&!/[。!?!?;;][))】」》”’"']*$/u.test(a.cells.at(-1).trim())}function q(a,b,c,d){let{witnessSha256:e,...f}=a,h=d.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),i=d.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]),j=1===h.length&&1===i.length&&i[0]>=h[0]?d.slice(h[0],i[0]+1):[];if(!b||"native-table-page-bridge-v2"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!p(a.from,a.to)||!j[0]||!j.at(-1)||!n(a.from,j[0])||!n(a.to,j.at(-1))||a.spansSha256!==o(j)||!j.includes(b)||!j.includes(c)||!a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start))throw Error("原生表格续行与完整layout/source spans证据不一致")}function r(a,b){let c=[...a];for(let a=0;a<c.length;a++){let d,e=c[a]?.nativeTableRow;if(!e)continue;let h=c.findIndex((b,c)=>c>a&&!!b.nativeTableRow&&0!==b.nativeTableRow.row&&b.file===e.file);if(h<0)continue;let k=c[h].nativeTableRow;if(!p(e,k)||c.slice(a+1,h).some(a=>a.nativeTableRow&&(0!==a.nativeTableRow.row||a.nativeTableRow.page!==k.page||a.nativeTableRow.nativeProofSha256!==e.nativeProofSha256)))continue;let l=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b);return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||c.every((a,b)=>i(a)===i(k.headers[b]??"")))});if(c.slice(a+1,h).some(a=>!l(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text)))continue;let m=c[a],q=c[h],r=m.sourceSpans?.at(-1),s=q.sourceSpans?.[0];if(!r||!s||void 0===r.chunkIndex||void 0===s.chunkIndex)continue;let t=b.filter(a=>a.file===e.file&&a.chunkIndex>r.chunkIndex&&a.chunkIndex<s.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(t.length!==s.chunkIndex-r.chunkIndex-1)continue;let u=b.find(a=>a.file===e.file&&a.chunkIndex===r.chunkIndex),v=b.find(a=>a.file===e.file&&a.chunkIndex===s.chunkIndex);if(!u||!v)continue;let w=[{chunk:u,start:r.end,end:u.text.length},...t.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:v,start:0,end:s.start}];if(w.some(a=>!l(a.chunk.text.slice(a.start,a.end))))continue;let x=[r,...w.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:e.file,chunkIndex:a.chunkIndex,section:"PDF表格页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),...q.sourceSpans];try{d=function(a,b,c){if(!p(a,b)||!c[0]||!c.at(-1)||!n(a,c[0])||!n(b,c.at(-1)))throw Error("没有相邻页同表同列续行证据");let d=[];for(let a=1;a<c.length;a++){let b=c[a-1],e=c[a];if(b.chunkIndex!==e.chunkIndex){if(void 0===b.chunkIndex||e.chunkIndex!==b.chunkIndex+1)throw Error("表格续行不能跳过未保全的parse chunk");d.push({fromChunkIndex:b.chunkIndex,toChunkIndex:e.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:e.chunkSha256,fromEnd:b.end,toStart:e.start})}}let e={version:"native-table-page-bridge-v2",file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.nativeProofSha256,from:a,to:b,fromSpanSha256:o([c[0]]),toSpanSha256:o([c.at(-1)]),spansSha256:o(c),transitions:d};return{...e,witnessSha256:g(e)}}(e,k,x)}catch{continue}let y=[...m.sourceSpans,...x.slice(1).map((a,b)=>a.chunkIndex!==x[b].chunkIndex?{...a,sourceTableBridgeBefore:d}:a)];c.splice(a,h-a+1,{...m,text:y.map(a=>a.text).join("\n"),nativeTableRow:k,sourceSpans:y,sourceSpansSha256:(0,f.y)(y)}),a--}return c}let s=a=>/^-?\d{1,4}-?$/u.test(i(a)),t=a=>{let{lineSha256:b,...c}=a;return b===g(c)};function u(a){let{sha256:b,...c}=a;if(a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||b!==g(c))throw Error("原生普通页文件证据身份不一致");return a.pages.flatMap(b=>{if(b.glyphSha256!==g(b.glyphs))throw Error("原生普通页glyph指纹不一致");let c=[];for(let a of[...b.glyphs].filter(a=>a.str.trim()).sort((a,b)=>b.y-a.y||a.x-b.x)){let b=c.find(b=>Math.abs(b.y-a.y)<=Math.max(2,.45*a.height));b?b.glyphs.push(a):c.push({y:a.y,glyphs:[a]})}return c.map((d,e)=>{d.glyphs.sort((a,b)=>a.x-b.x);let f=d.glyphs.filter(a=>/[A-Za-z\p{Script=Han}]/u.test(a.str)),h={file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:b.page,pageGlyphSha256:b.glyphSha256,line:e,lineCount:c.length,text:d.glyphs.map(a=>a.str).join("").replace(/\|/gu,"\\|"),glyphIds:d.glyphs.map(a=>a.id),x:d.glyphs[0].x,xEnd:Math.max(...d.glyphs.map(a=>a.x+a.width)),y:d.y,height:Math.max(...d.glyphs.map(a=>a.height)),columnGap:d.glyphs.some((a,b)=>b>0&&a.x-d.glyphs[b-1].x-d.glyphs[b-1].width>2*Math.max(a.height,d.glyphs[b-1].height)),fontNames:[...new Set((f.length?f:d.glyphs).flatMap(a=>a.fontName?[a.fontName]:[]))].sort()};return{...h,lineSha256:g(h)}})})}let v=(a,b,c)=>{let d=(a=>{let b=j(a.rawText);if(b){if(!b.slice(0,-1).every(a=>!i(a)))return;return b.at(-1)}return a.rawText.trim().replace(/^#{1,6}\s+/u,"")})(b);if(b.file!==a.file||void 0===d)return!1;let e=i(d),f=i(a.text);return!!f&&("start"===c?e.startsWith(f):e.endsWith(f))};function w(a,b){let c=a[0],d=b[0];return c&&d&&i(c.text)===i(d.text)&&1.5>Math.abs(c.x-d.x)&&1.5>Math.abs(c.y-d.y)&&1.5>Math.abs(c.height-d.height)&&c.fontNames.join("|")===d.fontNames.join("|")?i(c.text):void 0}function x(a,b,c,d,e){let f,g=w(c,d),j=c.filter(a=>!s(a.text)&&i(a.text)!==g),k=d.filter(a=>!s(a.text)&&i(a.text)!==g),l=1.5>Math.abs(a.xEnd-b.xEnd)&&a.x>b.x&&j.some(c=>c.line<a.line&&1.5>Math.abs(c.x-b.x)&&c.fontNames.join("|")===b.fontNames.join("|")),m=1.5>Math.abs(a.x-b.x)||l,n=!!e&&h(e)&&e.file===b.file&&e.sourceSha256===b.sourceSha256&&e.nativeProofSha256===b.nativeProofSha256&&e.page===b.page&&1===e.row&&e.cells.slice(0,-1).every(a=>!i(a))&&i(e.cells.at(-1)??"").startsWith(i(b.text));return t(a)&&t(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.line===j.at(-1)?.line&&b.line===k[0]?.line&&m&&2>Math.abs(a.height-b.height)&&!a.columnGap&&!b.columnGap&&(n||l||!j.some(a=>a.columnGap)&&!k.some(a=>a.columnGap))&&a.fontNames.join("|")===b.fontNames.join("|")&&(f=b.text,!/^(?:第[零一二三四五六七八九十百\d]+[章条节]|[((]?[一二三四五六七八九十百\d]+[))]|[一二三四五六七八九十百\d]+[..、])/u.test(f.trim()))&&!!i(a.text)&&!!i(b.text)&&!/[。!?!?;;::][))】」》”’"']*$/u.test(a.text.trim())}function y(a,b){let c=new Set([...b.fromPageLines,...b.toPageLines].filter(a=>s(a.text)).map(a=>i(a.text)));return a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let d=a.trim(),e=i(d.replace(/^#{1,6}\s+/u,"")),f=/^#{1,6}\s+PDF 第\s*(\d+)\s*页$/u.exec(d),g=j(d);return f?Number(f[1])===b.from.page||Number(f[1])===b.to.page:!!c.has(e)||!!b.repeatedHeader&&e===b.repeatedHeader||!!b.toGridRow&&(/^#{1,6}\s+PDF 原生网格表格区域$/u.test(d)||"|"===d||!!g&&g.length===b.toGridRow.cells.length&&(g.every(a=>/^:?-{3,}:?$/u.test(a))||g.every((a,b)=>a===`列${b+1}`)||g.every((a,c)=>i(a)===i(b.toGridRow.headers[c]??""))))})}function z(a,b,c,d){let{witnessSha256:e,...f}=a,h=function(a,b){let c=b.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),d=b.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]);return 1===c.length&&1===d.length&&d[0]>=c[0]?b.slice(c[0],d[0]+1):[]}(a,d);if(!b||"native-text-page-bridge-v1"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!t(a.from)||!t(a.to)||a.to.page!==a.from.page+1||a.from.file!==a.file||a.to.file!==a.file||!a.fromPageLines.every(t)||!a.toPageLines.every(t)||a.repeatedHeader!==w(a.fromPageLines,a.toPageLines)||!x(a.from,a.to,a.fromPageLines,a.toPageLines,a.toGridRow)||a.from.sourceSha256!==a.sourceSha256||a.to.sourceSha256!==a.sourceSha256||a.from.nativeProofSha256!==a.nativeProofSha256||a.to.nativeProofSha256!==a.nativeProofSha256||!h[0]||!h.at(-1)||!v(a.from,h[0],"end")||!v(a.to,h.at(-1),"start")||a.toGridRow&&!n(a.toGridRow,h.at(-1))||a.spansSha256!==o(h)||!function(a,b,c,d){let e=d.indexOf(b);return!(e<0)&&d[e+1]===c&&void 0!==b.chunkIndex&&void 0!==c.chunkIndex&&!(c.chunkIndex<b.chunkIndex)&&!(c.chunkIndex>b.chunkIndex+1)&&(b.chunkIndex!==c.chunkIndex||b.chunkSha256===c.chunkSha256&&!(b.end>c.start))&&a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start)}(a,b,c,h)||h[0].chunkIndex===h.at(-1).chunkIndex&&(h.some(a=>a.chunkIndex!==h[0].chunkIndex||a.chunkSha256!==h[0].chunkSha256)||h.slice(1,-1).some(b=>!y(b.rawText,a))))throw Error("原生普通页续行与实际glyph/layout/source spans证据不一致")}function A(a,b,c,d){let e=c.flatMap(u),h=[...a],k=new Map,l=new Map,m=new Map,p=(a,b)=>JSON.stringify([a,b]);for(let a of e){let b=p(a.file,a.page);k.set(b,[...k.get(b)??[],a])}for(let a of[...b].sort((a,b)=>(a.file??"").localeCompare(b.file??"")||(a.chunkIndex??-1)-(b.chunkIndex??-1))){let b=a.file??"",c=[...a.text.matchAll(/^#{1,6}\s+PDF 第\s*(\d+)\s*页/gmu)].map(a=>({start:a.index,page:Number(a[1])}));l.set(p(b,a.chunkIndex),{initial:m.get(b),markers:c}),c.length&&m.set(b,c.at(-1).page)}let q=a=>{let b=l.get(p(a.file,a.chunkIndex));return b?.markers.filter(b=>b.start<a.start).at(-1)?.page??b?.initial},r=(a,b)=>(k.get(p(a.file,q(a)))??[]).filter(c=>v(c,a,b));for(let a=0;a<h.length;a++){let c=h[a],e=c.sourceSpans;if(!e)continue;let l=-1,m;for(let a=e.length-1;a>=0;a--){let b=r(e[a],"end").filter(a=>!s(a.text));if(1===b.length){l=a,m=b[0];break}}if(!m)continue;let t=k.get(p(m.file,m.page))??[],u=k.get(p(m.file,m.page+1))??[],z=w(t,u),A=u.find(a=>!s(a.text)&&i(a.text)!==z);if(!A)continue;let B=h.findIndex((b,c)=>c>a&&b.file===m.file&&b.sourceSpans?.[0]&&v(A,b.sourceSpans[0],"start")&&q(b.sourceSpans[0])===A.page);if(B<0)continue;let C=h[B],D=C.nativeTableRow,E=D&&1===D.row&&D.cells.slice(0,-1).every(a=>!i(a))&&C.sourceSpans?.[0]&&n(D,C.sourceSpans[0])?D:void 0;if(!x(m,A,t,u,E)||!E&&(C.clauseNo||C.sourceSpans?.[0]?.logicalBoundaryBefore||/^[^::,,。;;“”"'()()]{1,40}[::]/u.test(A.text)||d&&!d(c,C)))continue;let F=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b),d=i(b.replace(/^#{1,6}\s+/u,""));return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||s(d)||!!z&&d===z||!!E&&"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||!!z&&i(c.join(""))===z)});if(h.slice(a+1,B).some(a=>!F(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text))||e.slice(l+1).some(a=>!F(a.rawText)))continue;let G=h[B],H=G.sourceSpans?.[0],I=e.at(-1);if(!H||!I||void 0===H.chunkIndex||void 0===I.chunkIndex||H.chunkIndex<I.chunkIndex)continue;let J=b.filter(a=>a.file===m.file&&a.chunkIndex>I.chunkIndex&&a.chunkIndex<H.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(J.length!==Math.max(0,H.chunkIndex-I.chunkIndex-1))continue;let K=b.find(a=>a.file===m.file&&a.chunkIndex===I.chunkIndex),L=b.find(a=>a.file===m.file&&a.chunkIndex===H.chunkIndex);if(!K||!L)continue;let M=I.chunkIndex===H.chunkIndex?[{chunk:K,start:I.end,end:H.start}]:[{chunk:K,start:I.end,end:K.text.length},...J.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:L,start:0,end:H.start}];if(M.some(a=>a.end<a.start||!F(a.chunk.text.slice(a.start,a.end))))continue;let N=M.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:m.file,chunkIndex:a.chunkIndex,section:"PDF普通页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),O=[...e.slice(l),...N,H],P=[],Q=!0,R=I.chunkIndex===H.chunkIndex;for(let a=1;a<O.length;a++){let b=O[a-1],c=O[a];if(b.chunkIndex!==c.chunkIndex||R){if(void 0===b.chunkIndex||void 0===c.chunkIndex||c.chunkIndex<b.chunkIndex||c.chunkIndex>b.chunkIndex+1||b.chunkIndex===c.chunkIndex&&(b.chunkSha256!==c.chunkSha256||b.end>c.start)){Q=!1;break}P.push({fromChunkIndex:b.chunkIndex,toChunkIndex:c.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:c.chunkSha256,fromEnd:b.end,toStart:c.start})}}if(!Q)continue;let S={version:"native-text-page-bridge-v1",file:m.file,sourceSha256:m.sourceSha256,nativeProofSha256:m.nativeProofSha256,from:m,to:A,fromPageLines:t,toPageLines:u,...E?{toGridRow:E}:{},...z?{repeatedHeader:z}:{},fromSpanSha256:o([O[0]]),toSpanSha256:o([O.at(-1)]),spansSha256:o(O),transitions:P},T={...S,witnessSha256:g(S)};if(R&&O.slice(1,-1).some(a=>!y(a.rawText,T)))continue;let U=[...N,H],V=[...e,...U.map((a,b)=>R||a.chunkIndex!==(b?U[b-1]:I).chunkIndex?{...a,sourceNativeTextBridgeBefore:T}:a),...G.sourceSpans.slice(1)];h.splice(a,B-a+1,{...c,text:V.map(a=>a.text).join("\n"),sourceSpans:V,sourceSpansSha256:(0,f.y)(V)}),a--}return h}},45455:(a,b,c)=>{c.d(b,{Bj:()=>j,xj:()=>i});var d=c(77598);let e=new Set(["decisionId","requestId","toolCallId","capturedAt","recordedAt","startedAt","endedAt","finishedAt","elapsedMs","durMs","queryTimeMs"]);function f(a){return Array.isArray(a)?a.map(f):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>!e.has(a)).sort(([a],[b])=>a.localeCompare(b)).map(([a,b])=>[a,f(b)])):a}let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(f(a))).digest("hex"),h=a=>a&&"object"==typeof a&&!Array.isArray(a)?a:void 0;function i(a){return a.flatMap(a=>{let b=h(a.data);if(!a.ok||!b)return[];if("ask_chief"===a.toolName){if("model"!==b.source)return[];let a=Object.fromEntries(("use-facts"===b.action?["factIds"]:"use-sources"===b.action?["sourceIds"]:"engineering-controls"===b.action?["controls","writingControls"]:"qualitative-controls"===b.action?["qualitativeControls"]:[]).filter(a=>Array.isArray(b[a])&&b[a].length>0).map(a=>[a,b[a]]));return Object.keys(a).length?[g(["chief-decision",b.taskId,b.action,a])]:[]}let c=Object.fromEntries(("query_construction_plan"===a.toolName?["activities","plannedResources","numbers","materials"]:"query_project_facts"===a.toolName?["candidates","sourceEvidence"]:"query_cad_context"===a.toolName?["records"]:"query_source_units"===a.toolName?["units"]:"read_source"===a.toolName?["chunks"]:["search_evidence","query_work_packages","discover_files"].includes(a.toolName)?["items"]:"list_skills"===a.toolName?["skills"]:"match_skills"===a.toolName?["matched"]:[]).flatMap(c=>{if(!Array.isArray(b[c]))return[];let d=b[c].filter(b=>{let c=h(f(b));return!!c&&!!Object.keys(c).length&&("read_source"!==a.toolName&&"search_evidence"!==a.toolName||"string"==typeof c.content&&!!c.content.trim())}),e="search_evidence"===a.toolName?d.map(a=>Object.fromEntries(Object.entries(h(a)).filter(([a])=>!["score","rank","retrievalRank","retrievalScore"].includes(a)))):d;return e.length?[[c,e]]:[]}));"load_skill"===a.toolName&&h(b.skill)&&(c.skill=b.skill);let d=Object.fromEntries(["snapshotId","projectSnapshotId","contractId",..."query_construction_plan"===a.toolName?["id"]:[],"filePath","relativePath","parsedIdentity","sceneVersion","kind","frameId","rootInstanceId","units","metadata","sourceVersionEligibility"].filter(a=>void 0!==b[a]).map(c=>[c,"metadata"===c&&"read_source"===a.toolName&&h(b[c])?Object.fromEntries(Object.entries(h(b[c])).filter(([a])=>!["mtime","indexedAt"].includes(a))):b[c]])),e=Object.entries(c).flatMap(([c,e])=>(Array.isArray(e)?e:[e]).map(e=>{let f=h(e);if("query_project_facts"===a.toolName&&f?.factId&&"verified-source-excerpt"!==f.roleId)return g(["project-fact",b.snapshotId??b.projectSnapshotId,f.factId,f.value,f.controlContext??null,h(f.sourceVersionEligibility)?.status??null]);if("query_project_facts"===a.toolName&&f&&(f.sourceEvidenceId||"verified-source-excerpt"===f.roleId))return g(["source-excerpt",b.snapshotId??b.projectSnapshotId,f.sourceEvidenceId??f.factId,f.value]);let i="query_construction_plan"===a.toolName&&"numbers"===c&&f?Object.fromEntries(Object.entries(f).filter(([a])=>"basisId"!==a)):e;return g(["source-material",a.toolName,d,c,i])}));return Number.isSafeInteger(b.offset)&&Number.isSafeInteger(b.nextOffset)&&Number(b.nextOffset)>Number(b.offset)&&e.push(g(["source-cursor",a.toolName,d,{offset:b.offset,nextOffset:b.nextOffset}])),e})}async function j(a){let b,{budget:c}=a,e=[...a.initialMessages],f=0,h=0,j="模型未产出可用正文",k="turns-exhausted",l=new Set(i(a.initialEvidence??[])),m=new Set,n=0;for(let o=1;void 0===c.maxTurnsPerBlock||o<=c.maxTurnsPerBlock;o+=1){if(void 0!==c.maxToolCallsPerBlock&&f>=c.maxToolCallsPerBlock){j=`显式工具调用预算耗尽(${f}/${c.maxToolCallsPerBlock})`,k="tool-budget-exhausted";break}let p=await a.runTurn({system:a.system,messages:e,turn:o,...void 0!==c.maxToolCallsPerBlock?{toolCallLimit:Math.max(0,c.maxToolCallsPerBlock-f)}:{}});if(h=o,f+=p.toolCalls.length,p.refused)return a.onTurn?.({turn:o,residual:b?.residual??0,toolCalls:f,action:"unfixable"}),b?{kind:"unfixable",content:b.content,turn:o,residual:b.residual,toolCalls:f,reason:p.refused.message,issues:[],cause:"budget-refused"}:{kind:"budget_refused",turn:o,reason:p.refused.message,refused:p.refused};let q=i(p.toolResults??[]);p.protocolRecovery?.sentOutputBudget!==null&&p.protocolRecovery?.sentOutputBudget!==void 0&&q.push(g(["protocol-recovery",p.protocolRecovery.sentOutputBudget]));let r=q.some(a=>!l.has(a));q.forEach(a=>l.add(a)),r&&(n=0);let s=p.committed||p.text;if(s?.trim()){let c=await a.check(s),g=c.issues.filter(a=>"error"===a.level||"blocker"===a.severity).length;if(c.degraded.length>0&&!c.executed.length)return a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:s,turn:o,residual:g,toolCalls:f,reason:`自查维度全部降级(${c.degraded.join("、")}),本块未做自查,保留当前草稿`,issues:c.issues,cause:"checks-degraded"};if(0===g&&!c.degraded.length)return a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"commit"}),{kind:"passed",content:s,turn:o,residual:g,toolCalls:f};let h=(0,d.createHash)("sha256").update(JSON.stringify([s,c])).digest("hex"),i=m.has(h);if(m.add(h),(!b||g<b.residual)&&(b={content:s,residual:g}),i&&!r){j="相同候选与裁决重复,未取得新证据或改善",k="no-progress";break}a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"regenerate"}),e=[...e,...p.toolMessages??[],{role:"assistant",content:s},{role:"user",content:function(a,b){let c=a.filter(a=>"error"===a.level||"blocker"===a.severity),d=c.slice(0,12).map((a,b)=>`${b+1}. ${a.detectorId?`[${a.detectorId}] `:""}${a.message}`),e=c.slice(12),f=new Map;for(let a of e){let b=a.detectorId||"(未标注判据)";f.set(b,(f.get(b)||0)+1)}let g=e.length>0?`${e.length} 条未逐条列出,按判据分布:${[...f.entries()].map(([a,b])=>`${a} ${b} 条`).join("、")}`:"";return[...b&&b.band?[`【篇幅】本稿 ${b.draftedChars} 字 / 目标 ${b.band.label}(${b.band.min}~${b.band.max} 字)——`+(b.draftedChars>b.band.max?`超出 ${b.draftedChars-b.band.max} 字:按"替换/合并"收口,**不得**再追加新内容`:b.draftedChars<b.band.min?`还差 ${b.band.min-b.draftedChars} 字:就地补足实质内容(不得灌水、不得复读)`:"落在目标带内,保持篇幅、只修下列问题")]:[],"【自查裁决】本稿未通过判据,下列问题必须修正后重新输出完整本节正文:",...d,g,"修正要求:直接输出修正后的**完整**本节正文(不要只输出改动片段、不要解说改动过程);保留原有事实、数值与结论,不得以删除内容的方式规避问题。"].filter(Boolean).join("\n")}(c.issues,{draftedChars:s.length,...a.lengthBand?{band:a.lengthBand}:{}})}];continue}let t=p.toolMessages??[];if(r)e=[...e,...t];else{let a=++n;if(a>=3){j="相同无进展状态在具体反馈后仍未取得新证据、游标或主控决定",k="no-progress";break}e=[...e,...t,{role:"user",content:1===a?"本轮没有新增可用来源、分页游标或已接受的主控决定。原始工具回执已保留;空结果或失败不证明资料缺失,也不能用改查询词、调用ID或再报缺来冒充进展。请依据已取得的资料换用有实际依据的工具/继续真实nextOffset,或向已接线的主控说明具体对象、已查范围与失败;若仍无法核定,保留真实decisionRequests并提交已能完成的正文,不编造参数或条件。":"再次没有新增证据。立即停止重复取证:把已能完成的正文按协议提交(未决事项写入decisionRequests保留),拟定配置按工程经验带依据给出(正文标“拟定”并登记plannedNumbers);继续同类工具调用不会产生新证据。"}]}void 0!==c.maxTurnsPerBlock&&o>=c.maxTurnsPerBlock&&(j="显式轮次预算耗尽,模型尚未提交正文")}return b?(a.onTurn?.({turn:h,residual:b.residual,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:b.content,turn:h,residual:b.residual,toolCalls:f,reason:j,issues:[],cause:k}):{kind:"no_content",turn:h,reason:j}}},47262:(a,b,c)=>{function d(a){let b=e()?.semanticFingerprints?.[a];return"string"==typeof b&&/^[a-f0-9]{64}$/u.test(b)?b:void 0}function e(){let a='{"version":1,"sourceFingerprint":"77d815e00c04639e13f00085615df788b0e214c81a14c8f0ba89cbbe491ff7c3","semanticFingerprints":{"projectFacts":"c3fc316e1569acc307286c85126177a5bad2ad2c13fd5b4e7954b01698ce2fde","documentGeneration":"e60253ca7b4cce803387e24f8e008907f38fe2d56c9918228251e83b2ad354b5"},"gitCommit":"7507c09e332fbc3c131d96116fd15e4acbe71320","serverVersion":"4.60.0","sourceFiles":704,"capturedAt":"2026-10-12T09:36:12.121Z"}';if(a)try{let b=JSON.parse(a);if(1!==b.version||!/^[a-f0-9]{64}$/u.test(b.sourceFingerprint??"")||"string"!=typeof b.serverVersion||"number"!=typeof b.sourceFiles||"string"!=typeof b.capturedAt||null!==b.gitCommit&&"string"!=typeof b.gitCommit)return;return b}catch{return}}c.d(b,{C:()=>d,S:()=>e})},48825:(a,b,c)=>{c.d(b,{Jf:()=>j,V2:()=>i,bp:()=>d,wJ:()=>e});let d="professional-writing-guidance-v3-professional-first-draft-2026-10-11",e={building:{fileName:"施工组织设计章节写作分析与编制规范(建筑).docx",sha256:"9313607509897e9a252cdefd671c4c72025d2727411972788bfa61b9835a0ff2",pages:12},municipal:{fileName:"施工组织设计章节写作分析与编制规范(市政).docx",sha256:"8e36d97e7084464ab04776093550e10984d3ac4a2a64ac37d5ca74a13a3ccc82",pages:13},bidWriting:{fileName:"技术标写作指南(合肥AI评标).docx",sha256:"3f36e67531da8ac9ffb1847694403ec4246457e445612767b3a82acf02894d0e"},bidReview:{fileName:"青天大模型AI评标规则考证(2026-10-11).docx",sha256:"de976918a1a0f1486cb07e1c2fd4a72a3b86fa480cbd46353f4c1af372badc69"}},f=["先形成工程对象、工作包、部署、资源及时间的共同推演,再按交付目录组织成文。事实、数量、工作面、部位、班组、节点在各章共用稳定身份,作者不各自编数字。","功能职责不等于固定章节:概况解释条件与影响,部署决定空间和顺序,方法说明实施,质量说明检查,安全说明风险与处置,进度说明时间,平面说明现场组织,移交说明最终闭环。推荐母目录不覆盖招标或用户锁定结构。","工作包数量与方法连通,方法与资源连通,资源与工期迭代校核;材料到货早于使用,检测和必要等待进入转序与时间逻辑。同一机械或班组同期不能在不同工作面重复占用。","施工方法、部署、真正重难点与进度应充分展开;人材机重点算准,管理计划重点完成执行闭环,概况与编制依据保持准确简洁。详略按职责和风险,不按统一字数、参数密度或固定图表数量。","表格按真实数据形态选择:单项目多属性用“信息项—内容”纵向或按属性含义分组;多对象在相同指标下比较、配置或排程时才横向展开。字段宽度应容纳完整对象、控制数值和单位,不能把大量无比较目的的属性铺成十几列单行,或把长范围原文挤进窄格。真实阶段或对象矩阵需要宽表时保留全部字段与对应关系,按职责合理分组,不设置固定列数上限、不强制各章制表,不删表行、数值或对象迎合评价。","项目事实依据与技术规范依据分别治理;前者确定实际工程,后者核验控制与验收。核验规范编号、名称、实施日期、状态、替代及局部废止和对象范围;参考文件列出的编号不等于本次已验证有效。","计算、产能假设和规范查证保留内部审计,正文交付核定的配置与控制结果及必要实施条件,不堆算式和来源说明。引用规范仅限确有技术参数、验收或强制边界需要的地方。","首稿采用专业短句和必要分点:条件决定方法,动作达到可检状态,状态放行下一工序。正文工序名不以箭头串替代实施方法;实际流程图和活动网络保留其关系,图后不逐节点逐连线重复全文。","专业标题说明工程对象、方法或组织职责,不拼接关键词、不照抄内部评审标签。正常技术名称重复不导致丢弃、换名或重写;同项目再次编制仍以实际条件和方案质量为准。","写作指南中的样本统计只提供观察线索,不构成评分算法;图片数、箭头数、元数据软件、标题关键词和入围差值不授予质量或真实性。项目实际要求与专业适用规则优先,不为低频统计删去必要风险和接口。"],g={building:"建筑工程按实际楼栋、楼层、流水段和专业接口组织;地下结构、主体、围护装修、机电与室外的先后和移交要一致。不能把房建通用专业强行加入实际没有的工程。",municipal:"市政按真实路线、桩号、区段和工作面组织,明确起点、推进方向、地下与地上转序;涉及社会交通时,导改、围挡、施工阶段、居民出行与施工车辆路线联动。场内便道与场外交通分开。"},h=[{id:"overview",label:"项目理解",match:/概况|项目理解|整体理解|现场条件|工程清单|专业构成/u,buildingPages:[2],municipalPages:[2],guidance:"给出事实及其对施工组织的影响,按专业呈现必要工程量;不复制设计说明、不提前展开工艺,不以无来源地质、距离或道路数据制造针对性。"},{id:"deployment",label:"总体部署",match:/总体部署|施工部署|流水段|工作面|施工区段|施工顺序/u,buildingPages:[2,3],municipalPages:[2,3],guidance:"明确区段和工作面对应哪些任务及工程量、划分理由、起点、方向、先后与穿插、专业移交条件。后续方法、资源和进度必须能从部署找到组织依据。"},{id:"difficulties",label:"重难点",match:/重难点|重点难点|项目特点|制约因素/u,buildingPages:[3,4],municipalPages:[3,4],guidance:"由真实项目证据辨识制约因素,解释原因和后果,给出技术组织、资源、检查及异常处置;只深写真正核心问题,并在相关方法、质量、安全或工期中闭合。"},{id:"method",label:"施工方法",match:/工艺|工法|施工方法|施工技术|浇筑|开挖|吊装|安装|支模/u,buildingPages:[4,5],municipalPages:[4,5],guidance:"对本节实际承担的分项写清对象和工作量、前提、顺序、步骤、材料机具工种、控制、接口、检查、异常和转序。普通工序可组织可检查,核心工序达到必要技术策划深度;不把施组全文变成专项计算书。"},{id:"materials",label:"材料供应",match:/材料|物资|永久设备|供应|采购|人材机/u,buildingPages:[5],municipalPages:[5],guidance:"数量由实际工程量或可靠换算取得,供应与工作面及使用窗口衔接;长周期构件设备串联确认、采购、到货和安装。区分施工机械与永久设备、产品标准与验收标准;不能可靠换算时不假算。"},{id:"equipment",label:"机械与仪器",match:/机械|机具|检测仪器|人材机|确保机/u,buildingPages:[5,6],municipalPages:[5,6],guidance:"关键机械以工作量、可用作业窗口、实际单机或机组能力核定数量,检查同期占用和转场。检测仪器服务实际检验。运距未知不能虚构运输循环时间;算式留审计,不抄经验台数。"},{id:"labor",label:"劳动力",match:/劳动力|班组|工种|人材机|确保人/u,buildingPages:[6,7],municipalPages:[6],guidance:"以班组、工作面、阶段和工种组织投入,核算工作量、工日和持续时间;峰值由实际同期工种矩阵求得,不能相加各专业独立峰值。配置与特种作业必须符合真实任务。"},{id:"quality",label:"质量控制",match:/质量|检验|检测|隐蔽验收|复试|样板|三检/u,buildingPages:[7],municipalPages:[6,7],guidance:"围绕真实实体写检查对象、指标、方法、适用频次、岗位、记录、不合格处置、复验和销项;合格后才转序。方法章写实施,质量章写核验,避免再抄一遍工艺。"},{id:"safety",label:"风险安全与应急",match:/危大|危险源|风险|安全|应急|专项方案|论证/u,buildingPages:[7,8],municipalPages:[7,8],guidance:"实际作业、实体参数和影响对象支撑风险与危大判定,不能靠关键词。承担现场控制时给出作业条件、停止触发、监测和处置;辨识或审核子任务只承担其边界,完整应急由被委派任务负责。"},{id:"schedule",label:"进度组织",match:/进度|工期|节点|施工计划|施工窗口|确保人|确保机/u,buildingPages:[8,9],municipalPages:[8,9],guidance:"共同任务网络连接工作量、工作面、综合能力、材料到货、必要等待、检测与转序。开始结束和搭接可复核,关键路线由逻辑计算,不将箭头示意当网络计划。进度、正文与资源共用同一时间数据。"},{id:"environment",label:"环境与外部运行",match:/文明|环境|环保|扬尘|噪声|校园秩序|交通|既有|保护/u,buildingPages:[9],municipalPages:[9],guidance:"针对实际居民、校园、生产、交通、水体或既有设施说明影响、控制、检查责任及恢复;地方措施需按属地核验,不无条件复制某城市标准。涉及既有设施先调查再分析保护监测。"},{id:"site-layout",label:"现场空间组织",match:/总平面|平面布置|临时设施|临设|运输路线|便道|便桥/u,buildingPages:[9,10],municipalPages:[9,10],guidance:"按实际场地边界和阶段部署布置物流、堆场、机具、水电排水、消防及出入口,检查真实可通行与转场条件。缺尺寸不编坐标;必要实体决定未完成时由主控解决,不用模糊正文冒充已落地。"},{id:"handover",label:"验收恢复移交",match:/竣工|移交|交付|保修|缺陷责任|退场|恢复/u,buildingPages:[10],municipalPages:[10,11],guidance:"从已施工实体与系统反推检查、调试、整改复验、资料、培训和移交。市政还核对道路、交通、绿化及临设恢复;过程隐蔽验收不重复承担整套竣工移交。"}];function i(a){let b="building"===a||"municipal"===a?g[a]:"工程类型未确认时只使用共同写作原则,不能默认套用市政或房建专业条件。";return`【编制规范萃取 ${d},是写作方法先验,不是项目事实或已核现行标准】
122
+ ${d}`})};for(b.length&&(a.onProgress(b,c,d),u());;){g();let e=j?a.callOptions:a.readingCallOptions,k=j?q:[...q.filter(a=>a.name!==h.name&&"read_frozen_cad"!==a.name),H],l=await (0,r.Qf)(()=>(a.caller??r._v)({system:a.system??"你是负责专业边界、资料口径和作者协作的主智能体,使用实际工具查清工程对象及工况后裁决。",messages:s,tools:k,requireToolCall:!1,taskKind:e?.taskKind??"reasoning",diagnostics:a.diagnostics,signal:f,callKind:e?.callKind??"supervisor-decision",maxTokens:e?.maxTokens??12e3,temperature:0}),f);if(c.push(l??null),a.onProgress(b,c,d),g(),!l)throw Error("主控模型未返回有效响应,未执行读取或裁决");if(s.push({role:"assistant",content:l.content,toolCalls:l.toolCalls,...void 0!==l.thinkingContent?{thinkingContent:l.thinkingContent}:{}}),l.responseMetadata?.completed===!1){let e="本轮模型响应被截断,读取或提交均未执行;须根据实际响应容量返回完整工具请求,未闭合内容不执行";for(let a of(d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify({accepted:!1,performed:!1,error:e})});s.push({role:"user",content:e}),a.onProgress(b,c,d),o(e);continue}if(!l.toolCalls.length){d.push("本轮仅返回普通文本,未执行读取或裁决"),s.push({role:"user",content:`本轮普通文字未作为工程裁决执行。请调用已提供的读取工具继续查证,或调用${h.name}提交有实际依据的裁决。`}),a.onProgress(b,c,d),o("普通文字未执行工具裁决");continue}let t=l.toolCalls.filter(a=>a.name===H.name);if(!j&&(t.length||l.toolCalls.some(a=>a.name===h.name))){let e;if(1!==t.length||1!==l.toolCalls.length)e="普通源查证阶段不执行方案提交;结束准备与读取须分轮,之后用专业推理完整提交";else try{let a=JSON.parse(t[0].arguments);if(!a||"object"!=typeof a||Array.isArray(a)||Object.keys(a).some(a=>"reason"!==a)||"string"!=typeof a.reason||!a.reason.trim())throw Error("结束源查证须说明实际资料是否已足够及剩余未核事项");j=!0,m.clear(),p.push({reason:a.reason,engineeringDecision:"not-evaluated"})}catch(a){e=a instanceof Error?a.message:String(a)}for(let a of(e&&d.push(e),l.toolCalls))s.push({role:"tool",toolCallId:a.id,content:JSON.stringify(e?{performed:!1,accepted:!1,error:e}:{performed:!0,stage:"source-reading-finished",engineeringDecision:"not-evaluated",instruction:`准备阶段已结束;下一轮按专业推理调用${h.name}完整提交,当前没有采用任何工法候选`})});a.onProgress(b,c,d),u(),e&&o(e);continue}let v=l.toolCalls.filter(a=>a.name===h.name);if(1===v.length&&1===l.toolCalls.length){let e=y(a.project,b);try{let d=JSON.parse(v[0].arguments);return await (0,r.Qf)(()=>Promise.resolve(a.validateSubmission?.(d,e,b)),f),g(),{raw:d,reads:b,attempts:c,sources:e,...p.length?{preparationReceipts:p}:{}}}catch(h){g(),i=!0;let e=h instanceof Error?h.message:String(h);d.push(e);let f=e.includes("图纸泛指")||e.includes("转交图示")||e.includes("后续审批")?"把 instruction 改写成「对象+部位+工序动作+控制要求」的可执行句;删除“按图/按设计图/按审批/以…为准/待深化/报审后执行”等指向语,来源证明仍保留在 evidence 中。":e.includes("控制值须为明确数值及单位")?"单一工程控制值只能是明确数值+单位;来源原文是范围或约数时不得作为工程控制值——若它是源内条件义务,改用 action=qualitative-controls 的 conditional-duty 原样保留范围与完整条件;若只需正文引用原文,改用 action=use-sources。":e.includes("缺逐项独立用途复核")?"提交须逐项覆盖全部 controls:results 的 index 依次覆盖 0..controls.length-1,每项 status 与 reason 完整;漏项或重复即整次退回。":e.includes("非定性决定不能附加未核定采用许可")?"qualitativeControls 只能与 action=qualitative-controls 同时出现;engineering-controls 只提交 controls 数组,不得附带 qualitativeControls。":e.includes("工程适用性未确认")?"全部控制项必须逐项 confirmed;证据不足的部位关系保持 unmeasured 会导致整次退回——只提交已读证据足以支撑同一对象、工况、基准与适用条件的控制,其余以 use-sources 或 request-human 保留。":e.includes("未查询的来源")||e.includes("改写了原文")?"quote 必须是本次实际读取原文中的连续原字,sourceId 只能选择已返回的 sourceId。":"";s.push({role:"tool",toolCallId:v[0].id,content:JSON.stringify({accepted:!1,performed:!1,error:e,instruction:`${a.submission?"本次提交未采用;根据真实读取回执与本次校验错误纠正当前提案,不能把缺证据的关系宣称已核定或扩大提交范围。":"本次裁决未采用;只根据已读证据纠正当前提案,不用含数字的guidance或图示指向语绕过工程控制校验。"}${f?`纠正方向:${f}`:""}`})}),a.onProgress(b,c,d),u(),o(`裁决未通过独立校验:${e}`);continue}}for(let e of l.toolCalls){let f,h;g();try{if(v.length)throw Error("读取与提交须分轮;本轮混合请求全部未执行,请先完成查证");let b=JSON.parse(e.arguments),c="read_frozen_source"===e.name?"source":"read_frozen_cad"===e.name&&a.readCad?"cad":"read_frozen_work_packages"===e.name&&a.readWorkPackages?"work-package":void 0;if(!c)throw Error("主控请求了未提供的能力");let d=Object.keys(("source"===c?C:"cad"===c?D:F).properties);if(!b||"object"!=typeof b||Object.keys(b).some(a=>!d.includes(a)))throw Error("读取定位字段无效");let g="cad"!==c||b.kind&&"frames"!==b.kind?b:{limit:24,detail:"catalog",...b};(f={kind:c,query:g}).result="source"===c?n(a.project,g):"cad"===c?a.readCad(g):a.readWorkPackages(g),h=f.result}catch(b){let a=b instanceof Error?b.message:String(b);f?f.error=a:d.push(a),h={error:a,performed:!1}}f&&b.push(f),s.push({role:"tool",toolCallId:e.id,content:JSON.stringify(h)}),a.onProgress(b,c,d)}u(),o("实际读取没有新的源材料或游标"),s.push({role:"user",content:"已保留本轮实际读取;使用nextOffset继续真实未完成分页。重复同页或空结果不表示新增证据,不凭查证动作扩大用途。"})}})}catch(a){if(a instanceof G)throw a;throw g(),new G("OPERATION_FAILED",a instanceof Error?a.message:String(a),e,a)}}var J=c(41240),K=c(68959),L=c(9090);function M(a){let{controls:b,qualitativeControls:c,...d}=a;return{...d,...a.writingControls?{controls:a.writingControls}:{},...a.writingQualitativeControls?{qualitativeControls:a.writingQualitativeControls}:{}}}let N=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function O(a){let b=new Map;return c=>({ask:async d=>{let l=a.contract.sections.find(a=>a.id===c);if(!l||"string"!=typeof d.question||!d.question.trim()||d.question.length>4e3||!Array.isArray(d.criterionIds)||!d.criterionIds.length||new Set(d.criterionIds).size!==d.criterionIds.length||d.criterionIds.some(a=>!l.criterionIds.includes(a))||void 0!==d.factQueries&&(!Array.isArray(d.factQueries)||d.factQueries.some(a=>!a||"string"!=typeof a.attribute||!a.attribute.trim()||Object.keys(a).some(a=>!["attribute","objectName"].includes(a))||void 0!==a.objectName&&"string"!=typeof a.objectName)))throw Error("主控问题必须指向当前作者的具体职责");if(void 0!==d.sourceQueries&&(!Array.isArray(d.sourceQueries)||d.sourceQueries.some(a=>Object.keys(a).some(a=>!["query","filePath","offset","limit"].includes(a)))))throw Error("原文查询须明确实际定位条件");let m=(d.sourceQueries??[]).map(b=>n(a.project,b)),r=N([c,d]),s=b.get(r);if(s)return s;let t=(async()=>{var b,n;let s,t,u,v,x,y,z,B,C=a.contract.criteria.filter(a=>d.criterionIds.includes(a.id)),D=new Set(C.flatMap(a=>a.factIds??[])),E=(d.factQueries??[]).map(b=>(0,g.j)(a.project,b));for(let a of E)if("resolved"===a.status)for(let b of a.candidates)D.add(String(b.factId));let F=a.project.facts.filter(b=>D.has((0,e.vg)(b))&&(0,f.j)(b)&&Object.hasOwn(a.project.sources,b.sourceFile)).filter(a=>!(0,i.p)(a).requiresTechnicalDecision).filter(b=>!b.resolutionRef||!!(b.resolutionRef.winnerSourceFile&&Object.hasOwn(a.project.sources,b.resolutionRef.winnerSourceFile))).map(b=>({...(0,j.YL)(a.project,b),factId:(0,e.vg)(b),sourceFile:b.resolutionRef?.winnerSourceFile??b.sourceFile,sourceRef:b.resolutionRef?b.resolutionRef.winnerSourceRef??null:b.sourceRef??null})),G=["你是专业文档的主智能体,回答作者在正式提交首稿前遇到的具体问题。",...a.sharedPlan?[`【本轮共同组织候选与真实任务接口】${JSON.stringify((0,J.E6)(a.sharedPlan,a.contract.sections,l.id))}。在既有对象、阶段与接口内裁决,发现来源冲突须说明具体冲突,不能让作者独自另换工序或把未决值写成正文。`]:[],...a.contract.deliveryPolicy?[(0,h.Jf)({projectType:a.contract.writingKnowledge?.projectType,title:l.title,responsibility:l.responsibility,contentTypes:l.contentTypes}).text]:[],"可选择 use-facts(指向给定可靠事实)、use-sources(提供已查询的完整原文)、engineering-controls(真实定量控制及推导)、qualitative-controls(实际方法/定性采用或原源条件义务,独立复核后只授指定任务用途)、guidance(定性方法与职责指引)、request-human(资料或合同需改变)。","不得编造项目数值或标准限值,guidance只给方法建议,不构成任何数值或选型采用许可。已有原文的工程决定应提交具体controls或qualitativeControls独立核定,不以笼统组织词代替。先通过明确原文查询定位条件与方法;原文可用时提供完整来源,不因尚未抽成属性就直接交回人。确需外部资料或更改合同才保留未决。数值范围仍须按对象与阶段解析,不能任选端点。不要代写整节正文。",'只返回{"action":"guidance","answer":"可执行的回答","factIds":[],"sourceIds":[],"reason":"为何这样裁决"}。use-sources的sourceIds必须选择本次原文查询实际返回的来源身份。',"engineering-controls的factIds仅为controls中实际derivation.inputFactIds的去重并集;直接引用原文、没有算式时必须返回factIds:[]。读过的候选不等于采用的推导输入,不能把待核定范围放入factIds。每项工程控制的实质决定全部写入controls,answer只解释状态,不能用图示指向语替代控制项。","engineering-controls另须controls数组,每项为{objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}],derivation?:{formula,inputFactIds,basis}}。quote须来自已查询原文的真实连续引文,value须有数值及单位,condition明确适用部位与阶段,不泛化全工程;优先使用原文明确的控制标高等可执行属性,无须强行生成统一总深度。只有已提供的可靠单值事实可作推导输入,算式用$0、$1及四则括号,服务端核量纲与算术。sourceIds为全部实际用到的原文身份,factIds为全部推导输入;执行指引不添加未经核定的参数。裁决不会改写冻结项目事实或证明整篇合格。",'qualitative-controls另须qualitativeControls:[{category:"conditional-duty|project-adoption",objectName,attribute,condition,value,instruction,evidence:[{sourceId,quote}]}]。保持源内真实承担主体、触发、例外、适用对象。conditional-duty只能忠实履行源义务,不批准候选目录参数为当前选型。project-adoption须真实当前项目采用关系,参考选项须真实selector桥,未决A不批准采用。真正定量控制仍用engineering-controls。sourceIds为实际证据身份全集,factIds为[]。',"事实查询结果含完整口径状态;ambiguous/unbound/unmeasured/needs-technical-decision不能通过任选一个候选变成已确认施工值。概况范围不得取端点或平均值冒充各部位深度,分层厚度不能当坑深。分页未完成时不能声称已核完整集合。",JSON.stringify({task:l,criteria:C,facts:F,factQueries:E,question:d,sourceFiles:[...new Set([...F.map(a=>a.sourceFile),...m.flatMap(a=>a.sources.map(a=>a.filePath)),...Object.keys(a.project.sources).filter(a=>/\.(?:dwg|dxf)$/iu.test(a))])]})].join("\n"),H=`chief:${r.slice(0,28)}`,M=async(b,d,f)=>{if(!b||!["use-facts","use-sources","engineering-controls","qualitative-controls","guidance","request-human"].includes(b.action??"")||"string"!=typeof b.answer||!b.answer.trim()||b.answer.length>3e3||"string"!=typeof b.reason||!b.reason.trim()||!Array.isArray(b.factIds)||new Set(b.factIds).size!==b.factIds.length||b.factIds.some(a=>!F.some(b=>b.factId===a))||"use-facts"===b.action&&!b.factIds.length||"guidance"===b.action&&((0,q.ei)(b.answer).length||b.factIds.length))throw Error("主智能体裁决越过事实或职责边界,未执行");let g=b.sourceIds??[];if("request-human"===b.action&&function(a){let b=new Map,c=new Map;for(let d of a){if(d.error)return!0;if("cad"===d.kind){if(!d.result)return!0;let a=d.query,b=d.result;if(!Array.isArray(b.records)||!Array.isArray(b.oversizedRecords)||!Number.isSafeInteger(b.offset)||b.offset<0||"string"!=typeof b.parsedIdentity||"string"!=typeof b.projectSnapshotId)return!0;let e=JSON.stringify([a.filePath,a.kind??"frames",a.rootInstanceId??null,a.frameId??null,a.entityId??null,a.query??"",a.placement??"all",a.textOnly??!1,a.order??"source",a.detail??"full"]),f=c.get(e)??[];f.push({query:a,page:b}),c.set(e,f);continue}if("work-package"===d.kind&&d.result){let a=d.result;if(!0!==a.complete||a.items.length!==a.total)return!0;continue}if("source"!==d.kind||!d.result)continue;let a=d.query,e=JSON.stringify([a.filePath??null,a.query]),f=b.get(e)??[];f.push(d.result),b.set(e,f)}for(let b of c.values()){if(b.some(({page:a})=>a.oversizedRecords.length||a.parsedIdentity!==b[0].page.parsedIdentity||a.projectSnapshotId!==b[0].page.projectSnapshotId))return!0;let c=b.find(({page:a})=>null===a.nextOffset&&null!==a.total);if(["instances","frames"].includes(b[0].query.kind??"frames")&&!b[0].query.entityId&&!b[0].query.query&&b.some(({query:b,page:c})=>a.some(a=>{if("cad"!==a.kind||!a.result)return!1;let d=a.query;return d.filePath===b.filePath&&["annotations","geometry"].includes(d.kind??"")&&c.records.some(a=>void 0!==d.rootInstanceId&&a.payload.rootInstanceId===d.rootInstanceId||void 0!==d.frameId&&a.payload.id===d.frameId)})))continue;if(!c||null===c.page.total)return!0;let d=c.page.total,e=new Set;for(let{page:a}of b)for(let b=0;b<a.records.length;b+=1)e.add(a.offset+b);if(e.size!==d||[...e].some(a=>a>=d)||d>0&&!e.has(0))return!0}for(let a of b.values()){let b=a[0]?.matchedCount??0,c=new Set;for(let b of a)for(let a=0;a<b.sources.length;a+=1)c.add(b.offset+a);if(c.size!==b)return!0}return!1}(f))throw Error("相关冻结原文尚未完整定位,不能把未完成查询当作需要用户提供资料");if(!Array.isArray(g)||new Set(g).size!==g.length||g.some(a=>!d.some(b=>b.sourceId===a))||["use-sources","engineering-controls","qualitative-controls"].includes(b.action??"")&&!g.length||!["use-sources","engineering-controls","qualitative-controls","guidance"].includes(b.action??"")&&g.length)throw Error("主智能体原文选择没有冻结来源支持");if(["engineering-controls","qualitative-controls"].includes(b.action??"")&&!a.sharedPlan)throw Error("工程控制缺少本轮同版共享计划,不能声明新来源已经可以写入");let h="qualitative-controls"===b.action?await (0,L.lj)(b.qualitativeControls,{project:a.project,sources:d,task:l,criteria:C,taskId:c,planId:a.sharedPlan.id,decisionId:H,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer}):void 0;if(h){let a=new Set(h.controls.flatMap(a=>a.evidence.map(a=>a.sourceId)));if(b.factIds.length||a.size!==g.length||g.some(b=>!a.has(b)))throw Error("定性决定来源清单与实际证据不一致");v=h.sourceApplicationReceipt,u=h.review}else if(void 0!==b.qualitativeControls)throw Error("非定性决定不能附加未核定采用许可");let i="engineering-controls"===b.action?await w(b.controls,{project:a.project,sources:d,task:l,taskId:c,planId:a.sharedPlan.id,decisionId:H,criteria:C,facts:F,diagnostics:a.diagnostics,signal:a.signal,reviewer:a.engineeringReviewer,cadReadings:f.filter(a=>"cad"===a.kind)}):void 0;if(i){let a=new Set(i.controls.flatMap(a=>a.evidence.map(a=>a.sourceId))),c=new Set(i.controls.flatMap(a=>a.derivation?.inputFactIds??[]));if(g.length!==a.size||g.some(b=>!a.has(b))||b.factIds.length!==c.size||b.factIds.some(a=>!c.has(a)))throw Error("工程裁决来源清单与实际控制项不一致");u=i.review}else if(void 0!==b.controls)throw Error("非工程裁决不能附加未经复核的控制项");let j=i?.controls.map(b=>{let{objectName:c,attribute:d,condition:f,value:g,instruction:h}=b,i=b.derivation,j=i?.inputFactIds.length===1&&"$0"===i.formula.replace(/\s/gu,"")?a.project.facts.find(a=>(0,e.vg)(a)===i.inputFactIds[0]&&a.objectName===c&&[a.fieldId,a.fieldName,a.key,(0,e.nD)(a)?.key,(0,e.nD)(a)?.label,...(0,e.nD)(a)?.aliases??[]].some(a=>a&&(0,p.K3)(a)===(0,p.K3)(d))&&(0,p.K3)(a.value)===(0,p.K3)(g)):void 0,l=j&&(0,k.mk)(a.project,(0,e.vg)(j)).factIndex;return{objectName:c,attribute:d,condition:f,value:g,instruction:h,authorReferences:"number"==typeof l?{factIndices:[l]}:i?{derivedNumbers:[{formula:i.formula,inputFactIndices:i.inputFactIds.map(b=>(0,k.mk)(a.project,b).factIndex),basis:i.basis}]}:{sourceIndices:[...new Set(b.evidence.map(a=>a.sourceIndex))]}}}),m=h?.controls.map(({evidence:b,...c})=>{let d=b.map(b=>(0,k.mk)(a.project,void 0,b.sourceId).sourceIndex);if(d.some(a=>"number"!=typeof a))throw Error("定性决定来源没有本轮完整原文序号");return{...c,authorReferences:{sourceIndices:[...new Set(d)]}}}),n=i?`以下控制已独立复核,只用于指定对象及工况。按authorReferences在实际正文片段登记对应类型:factIndices引用既定事实,derivedNumbers登记算式,sourceIndices仅用于原文直接控制。证明中的范围句不支持派生或既定单值,不能给它们另挂原文索引;不把裁决身份当作新事实来源:${JSON.stringify(j)}`:h?`以下具体定性决定已经独立核定,严格保持各自category与适用对象条件;source-obligation-only不授当前选型或施工量。实际正文仍登记sourceIndices并逐次终评,不把许可当事实:${JSON.stringify(h.controls.map(b=>({...b,evidence:b.evidence.map(b=>({...b,...(0,k.mk)(a.project,void 0,b.sourceId)}))})))}`:"use-sources"===b.action?`以下是完整冻结原文,保留条件与来源,须判断适用性后编写;不自动转为已确认的项目单值:${JSON.stringify(d.filter(a=>g.includes(a.sourceId)))}`:"use-facts"===b.action?`采用冻结模型中的下列事实及其适用对象,不扩大其范围:${JSON.stringify(F.filter(a=>b.factIds.includes(a.factId)))}`:b.answer;return i&&(v=i.sourceApplicationReceipt),{decisionId:H,taskId:c,action:b.action,answer:n,factIds:b.factIds,...g.length?{sourceIds:g}:{},...i?{controls:i.controls,writingControls:j}:{},...h?{qualitativeControls:h.controls,writingQualitativeControls:m}:{},reason:b.reason,source:"model"}};try{let b=(a,b,c)=>{x=a,y=b,z=c,s=b.at(-1)},c=a.reviewer?await A({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,onProgress:b,ask:a.reviewer}):await I({project:a.project,prompt:G,initialSourceQueries:d.sourceQueries??[],readCad:a.readCad,readWorkPackages:b=>(0,o.H)(a.project,b),onProgress:b,diagnostics:a.diagnostics,signal:a.signal,validateSubmission:async(a,b,c)=>{B=await M(a,b,c)}});if(s=c.raw,x=c.reads,y=c.attempts,t=B??await M(s,c.sources,c.reads),a.signal?.throwIfAborted(),["engineering-controls","qualitative-controls"].includes(t.action)){if(!v)throw Error("本次工程控制没有同版来源用途证明,未执行");(0,K.WI)(a.project,v)}}catch(b){if(a.signal?.aborted)throw b;t={decisionId:H,taskId:c,action:"unmeasured",answer:"本次主控裁决未通过,未核定新的事实或技术决定;不能据此认定需要用户确认。实质技术问题须具体说明对象和工况后重新查询;已完成的正文交submit_author_task,不能以本回执代替内容验收。",factIds:[],reason:b instanceof Error?b.message:String(b),source:"model-rejected"}}return a.onReceipt({decision:t,question:d,inputHash:N(G),raw:s??null,...x?{reads:x,attempts:y,readingProtocolErrors:z}:{},...void 0===u?{}:{engineeringReview:u},...["engineering-controls","qualitative-controls"].includes(t.action)&&v?{sourceApplicationReceipt:v}:{}}),b=a.diagnostics,n={at:c,decisionId:H,action:t.action,reason:t.reason,readings:d.question,source:t.source,execution:"model-rejected"===t.source?"unlanded":"performed",executionNote:"model-rejected"===t.source?"模型裁决未通过,未执行新的技术决定,不登记为人工资料缺口":"通过工具回执返回当前作者;正文是否采用由候选与合同评价核对"},b&&(b.supervisorDecisionLog??=[]).push(n),t})();return b.set(r,t),t}})}},31859:(a,b,c)=>{c.d(b,{I:()=>i});var d=c(96770),e=c(19668),f=c(43967);let g=globalThis,h=g.__customizeConfigStores??=new Map;function i(){(0,f.jF)();let a=(0,e.J0)();return h.has(a)||h.set(a,new d.ConfigStore(a)),h.get(a)}},34027:(a,b,c)=>{c.d(b,{RT:()=>g,Ri:()=>f,zV:()=>h});var d=c(77598),e=c(73123);function f(a,b){return(0,e.gM)(a),Object.fromEntries(Object.entries(b).map(([b,c])=>{let e=a.sources[b],f=a.documents.find(a=>a.sourceFile===b);if(!e||!f||e.sourceSha256!==c.sourceSha256||e.parsedSha256!==c.parsedSha256)throw Error(`一致性来源上下文与冻结解析/源身份不一致:${b}`);let g=a.decisions.filter(a=>a.currentSourceFiles.includes(b)||a.candidateSourceFiles.includes(b)||f.domainDependencies.some(b=>b.family===a.family&&b.domain===a.domain)),h=a.declarations.filter(a=>a.sources.some(a=>a.sourceFile===b)||g.some(b=>b.declarationIds.includes(a.id))),i={version:"tender-source-context-v3",policyVersion:a.version,policyId:a.policyId,assetFingerprint:a.assetFingerprint,sourceIdentity:structuredClone(e),document:structuredClone(f),declarations:structuredClone(h),decisions:structuredClone(g),applicability:g.map(a=>({family:a.family,domain:a.domain,status:a.status,current:a.currentSourceFiles.includes(b),candidate:a.candidateSourceFiles.includes(b)}))};return[b,{...i,contextFingerprint:(0,d.createHash)("sha256").update(JSON.stringify(i)).digest("hex")}]}))}function g(a){let{contextFingerprint:b,...c}=a;if("tender-source-context-v3"!==c.version||c.policyVersion!==e.xg||b!==(0,d.createHash)("sha256").update(JSON.stringify(c)).digest("hex")||![c.policyId,c.assetFingerprint,c.sourceIdentity?.sourceSha256,c.sourceIdentity?.parsedSha256].every(a=>/^[a-f0-9]{64}$/u.test(a))||!c.document?.sourceFile?.trim()||!Array.isArray(c.document.editionScopes)||!Array.isArray(c.document.scopeEvidenceChunks)||c.document.families.some(a=>!c.document.editionScopes.some(b=>b.family===a))||c.document.scopeEvidenceChunks.some(a=>a.sha256!==(0,d.createHash)("sha256").update(a.text).digest("hex")))throw Error("职责来源适用资格缺少当前冻结源/解析/版本上下文身份或发行作用范围,或被改写")}function h(a){g(a);let b=a.document;return{document:{sourceFile:b.sourceFile,title:b.title,isClarification:b.isClarification,projectIdentifier:b.projectIdentifier,issuedAt:b.issuedAt,families:b.families,editionScopes:b.editionScopes.map(a=>({family:a.family,mode:a.mode,heading:a.heading})),domainDependencies:b.domainDependencies.map(a=>({family:a.family,domain:a.domain,quote:a.quote,authoritySources:a.authoritySources.map(a=>({sourceFile:a.sourceFile,quote:a.quote}))}))},declarations:a.declarations.map(a=>({id:a.id,family:a.family,domains:a.domains,quote:a.quote,issuedAt:a.issuedAt,projectIdentifier:a.projectIdentifier,title:a.title,sources:a.sources.map(a=>({sourceFile:a.sourceFile}))})),applicability:a.applicability,decisions:a.decisions.map(a=>({id:a.id,declarationId:a.declarationId,declarationIds:a.declarationIds,family:a.family,domain:a.domain,status:a.status,reason:a.reason,current:a.currentSourceFiles.includes(b.sourceFile),candidate:a.candidateSourceFiles.includes(b.sourceFile)}))}}},35821:(a,b,c)=>{c.d(b,{Eh:()=>f,Mv:()=>o,VN:()=>h,Iu:()=>i});var d=c(19898),e=c(73055);let f=.6,g=null;function h(){return g||(g=new d.LocalTransformersEmbeddingProvider({})),g}async function i(){if("1"!==process.env.DOCUMENT_SKIP_EMBED_PREFLIGHT)try{await h().embedQuery("生成前置检查")}catch(b){let a=b instanceof Error?b.message:String(b);throw Error(`本地语义模型预热失败(生成前置检查,可用 DOCUMENT_SKIP_EMBED_PREFLIGHT=1 跳过):${a}`,{cause:b})}}let j=new Map,k=0,l=0;async function m(a,b){let c=b?await b(a):await h().embedDocuments(a);if(c.length!==a.length)throw Error(`本地语义模型嵌入数量不一致:期望 ${a.length} 条,实际 ${c.length} 条`);return c}async function n(a,b){if("0"===process.env.DOCUMENT_EMBED_CACHE)return m(a,b);let c=Array(a.length),d=[],e=new Map;for(let b=0;b<a.length;b+=1){let f=a[b];if(f.length<=2e3){let a=j.get(f);if(a){c[b]=a,k+=1,j.delete(f),j.set(f,a);continue}}let g=e.get(f);g?g.push(b):(e.set(f,[b]),d.push(f))}if(0===d.length)return c;let f=await m(d,b),g=function(){let a=Number(process.env.DOCUMENT_EMBED_CACHE_SIZE||4e4);return Number.isFinite(a)&&a>0?a:4e4}();for(let a=0;a<d.length;a+=1){let b=d[a],h=f[a],i=e.get(b);for(let a of i)c[a]=h;if(b.length<=2e3&&(l+=i.length,j.set(b,h),j.size>g)){let a=j.keys().next().value;void 0!==a&&j.delete(a)}}return c}async function o(a,b,c){if(0===a.length||0===b.length)return()=>0;let d=[...a,...b],f=await n(d,c),g=new Map;for(let a=0;a<d.length;a++)g.has(d[a])||g.set(d[a],f[a]);return(a,b)=>{let c=g.get(a),d=g.get(b);return c&&d?(0,e.Om)(c,d):0}}},36372:(a,b,c)=>{c.d(b,{M8:()=>l,a0:()=>k,hM:()=>j});var d=c(35821),e=c(86697);let f=["对与评标活动有关的工作人员的纪律要求","评标委员会成员与投标人接触的限制","评标纪律与廉洁从业承诺要求","评审争议处理与投标澄清配合程序","评审结果确认与中标公示流程","评标办法与分值构成说明","异常低价评审与计算方式说明","清单计量与报价口径约定","投标文件实质性响应要求","投标保证金缴纳与退还程序","开标程序与投标文件递交截止时间","评标期间行为管控与资料闭环","预付款与进度款支付比例约定","履约担保与保证金缴纳退还约定","价格波动与合同价款调整约定","暂列金额与暂估价使用约定","税费计取与发票结算约定","违约责任与罚款赔偿条款"],g=["劳动力配置计划与高峰期人数安排","施工质量保证措施与验收标准","安全生产管理与教育培训要求","施工进度计划与关键线路安排","材料设备采购进场计划与检验要求","施工现场文明施工与环境保护管理","劳动纪律与班组作业管理制度","施工机械设备配置与维护保养计划","农民工工资支付保障与劳务实名制管理","材料采购质量证明与进场验收管理","工期承诺与进度考核奖惩管理"],h=/评标|投标|行贿|打招呼|递条子|廉洁|串标|围标|弄虚作假|干扰评标|纪律|澄清|中标|报价|清单计量|评审|保证金|开标|递交|争议|异常低价|评标基准价|预付款|进度款|担保|价格波动|材料调差|暂列金额|暂估价|计税|税金|发票|违约|业绩证明|类似(?:工程)?业绩|获奖|荣获|协会颁发|营业执照|资质证书|安全生产许可证|认证证书|管理体系认证|审计报告|信用等级|信用评价|社保证明|无行贿犯罪|中标查询|中标公示|中标结果|电子交易系统|公共资源交易|质疑投诉|评标委员会/u;function i(a){let b=a.sectionTitle?.trim()||"",c=(a.content||"").replace(/\s+/gu," ").slice(0,400);return b?`${b}。${c}`:c}function j(a){let b=a.sectionTitle?.trim()||a.content.replace(/\s+/gu,"").slice(0,60);return`${a.filePath}::${b}`}async function k(a,b){if(0===a.length)return{safe:[],excluded:[]};let c=a.filter(a=>h.test(i(a)));if(0===c.length)return{safe:[...a],excluded:[]};let e=c.map(i),j=await (0,d.Mv)(e,[...f],b),k=await (0,d.Mv)(e,[...g],b),l=new Set;for(let a of c){let b=i(a),c=Math.max(...f.map(a=>j(b,a))),d=Math.max(...g.map(a=>k(b,a)));c>=.6&&c>d&&l.add(a)}return{safe:a.filter(a=>!l.has(a)),excluded:[...l]}}async function l(a){return(0,e.A)({prototypes:[...f],negativePrototypes:[...g],threshold:.6,embedDocuments:a})}},36594:(a,b,c)=>{c.d(b,{LA:()=>k,Yn:()=>i,ZB:()=>j,eW:()=>l});var d=c(77598),e=c(97979),f=c(83653),g=c(57268);let h=a=>(0,d.createHash)("sha256").update(a).digest("hex");function i(a,b){let c=new Map;for(let b of a){let a=[...b.content.matchAll(/(?:发布日期|发布于|出具日期|印发日期)\s*[::]?\s*(20\d{2})\s*年\s*(\d{1,2})\s*月\s*(\d{1,2})\s*日/gu)].map(a=>`${a[1]}-${a[2].padStart(2,"0")}-${a[3].padStart(2,"0")}`);a.length&&c.set(b.filePath,[...c.get(b.filePath)??[],...a])}let g=a.flatMap(a=>{if(!["tender_document","addendum","tender","clarification","tender_text"].includes(a.roleId??""))return[];let d=b.sources[a.filePath];if(!d||void 0===a.chunkIndex)return[];let f=b.documents.find(b=>b.sourceFile===a.filePath),g=c.get(a.filePath)??[];return(0,e.Su)([{text:a.content,source:`${a.filePath} ${a.sectionTitle??""}`}]).filter(a=>a.openingDate&&"reference"!==a.openingDate.role).map(b=>({candidate:b,item:a,source:d,projectIdentifier:f?.projectIdentifier??null,issuedAt:1===new Set(g).size?g[0]:null,isClarification:f?.isClarification??!1}))}),i=new Map;for(let a of g){let b=a.candidate.openingDate,c=JSON.stringify([a.projectIdentifier,b.objectName,b.kind]),d=i.get(c)??[];d.push(a),i.set(c,d)}return[...i.values()].flatMap(a=>{let b,c=a.filter(a=>"current"===a.candidate.openingDate.role);if(!c.length)return[];let e=c.filter(a=>a.candidate.clarified),g=e.length&&c.every(a=>a.candidate.clarified||!a.isClarification)?e:c;if(new Set(g.map(a=>a.candidate.value)).size>1&&g.every(a=>a.issuedAt)){let a=[...g.map(a=>a.issuedAt)].sort().at(-1);g=g.filter(b=>b.issuedAt===a)}let i=(0,f.iC)({facts:[],overrides:[],labeledValues:g.map(a=>a.candidate)}).resolved.find(a=>"开工日期"===a.attribute);if(!i)return[];let j=g.find(a=>a.candidate.value===i.value&&i.evidence.some(b=>b.source===a.candidate.source));if(!j)return[];let k=j.candidate.openingDate,l=new Set(g.map(a=>a.candidate.value)).size>1||new Set(g.map(a=>(a.candidate.openingDate.condition??"").replace(/\s+/gu,""))).size>1,m=k.kind,n="planned"===m?"planned_start_date":"actual"===m?"actual_start_date":"construction_start_date",o="planned"===m?"计划开工日期":"actual"===m?"实际开工日期":"开工日期",p=[...new Set(l?a.filter(a=>"superseded"===a.candidate.openingDate.role).map(a=>a.candidate.value):[...i.superseded,...a.filter(a=>!g.includes(a)).map(a=>a.candidate.value)])].filter(a=>a!==i.value),q=a.map(a=>({value:a.candidate.value,sourceFile:a.item.filePath,chunkIndex:a.item.chunkIndex,quote:a.candidate.openingDate.quote}));return[{factId:`temporal:${(b=[n,k.objectName,j.item.filePath,j.item.chunkIndex,k.quote,i.value],(0,d.createHash)("sha256").update(JSON.stringify(b)).digest("hex")).slice(0,24)}`,fieldId:n,key:o,fieldName:o,objectName:k.objectName,value:i.value,confidence:l?.5:.95,sourceFile:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,sourceRef:{filePath:j.item.filePath,roleId:j.item.roleId,processingType:j.item.processingType,chunkIndex:j.item.chunkIndex,sectionTitle:j.item.sectionTitle,sourceSpan:k.quote,contextSpan:j.item.content},temporalConstraint:{event:"construction-start",kind:m,status:l?"unmeasured":"resolved",date:i.value,...k.condition?{condition:k.condition}:{},superseded:p,sourceSha256:j.source.sourceSha256,parsedSha256:j.source.parsedSha256,chunkSha256:h(j.item.content),quoteSha256:h(k.quote),history:q}}]})}function j(a,b){let c=b.filter(a=>a.temporalConstraint?.event==="construction-start"&&"planned"===a.temporalConstraint.kind&&"resolved"===a.temporalConstraint.status&&"项目主体"===a.objectName),d=1===new Set(c.map(a=>a.value)).size?c.slice(0,1):[];return{...a,facts:[...a.facts.filter(a=>"开工日期"!==(0,f.hf)(String(a.key??""),a.label)),...d.flatMap(a=>a.temporalConstraint.history.filter(b=>a.temporalConstraint.superseded.includes(b.value)).map(a=>({key:"开工日期",value:a.value,sourceFile:a.sourceFile})))],overrides:(a.overrides??[]).filter(a=>"date"!==(0,e.dm)(a.superseded)&&"date"!==(0,e.dm)(a.effective)),labeledValues:[...(a.labeledValues??[]).filter(a=>"开工日期"!==a.attribute),...d.map(a=>({attribute:"开工日期",value:a.value,source:`${a.sourceFile} ${a.sourceRef?.sectionTitle??""}`,clarified:!0,supersedesPriorMaterials:!1}))]}}function k(a){return a.filter(a=>a.temporalConstraint).map(a=>{let b=a.temporalConstraint,c="unmeasured"===b.status?"同一事件日期尚有未决值,须依据完整原文核定,不能任选一个日期或宣称已确定":`${a.fieldName}为${b.date};${"planned"===b.kind?"仅作进度计划起点,不得写成已确定的实际开工日":"保持该事件的原文性质"}`;return(0,g.v7)(`进度安排必须承接${a.objectName}的开工事件:${c}${b.condition?`;触发条件完整保留:${b.condition.replace(/\s+/gu,"")}`:""};仅采用现行事件口径,不新增工期或把通知条件删成固定日历承诺。`,JSON.stringify({type:"source-bound-temporal-fact",factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:b}))})}function l(a,b){let c=(0,e.Su)([{text:a.text,source:"reviewed-duty"}]).filter(a=>a.openingDate).flatMap(c=>b.filter(b=>{let d=b.temporalConstraint,e=c.openingDate;return d?.status==="resolved"&&d.superseded.includes(c.value)&&b.objectName===e.objectName&&("unspecified"===e.kind||e.kind===d.kind)&&d.history.some(b=>b.value===c.value&&a.sources.some(a=>a.file===b.sourceFile))}).map(a=>({label:c,fact:a}))),d=new Map;for(let a of c){let b=a.label.openingDate,c=`${b.dateStartChar}:${b.dateEndChar}`,e=d.get(c)??[];e.push(a),d.set(c,e)}let f=a.text,g=[];for(let a of[...d.values()].sort((a,b)=>b[0].label.openingDate.dateStartChar-a[0].label.openingDate.dateStartChar)){if(1!==new Set(a.map(a=>a.fact.value)).size)continue;let{label:b,fact:c}=a[0],d=b.openingDate;f=f.slice(0,d.dateStartChar)+c.value+f.slice(d.dateEndChar),g.push(c)}let h=[...new Map(g.map(a=>[a.factId,a])).values()];return h.length&&(f+=`;该日期控制已经由当前完整来源更正,${h.map(a=>`${a.fieldName}仅采用${a.value}${"planned"===a.temporalConstraint.kind?"作为计划基准,不能转成实际固定开工日":""}${a.temporalConstraint.condition?`,保留${a.temporalConstraint.condition.replace(/\s+/gu,"")}`:""}`).join(";")}`),{text:f,factIds:h.map(a=>a.factId),sources:h.map(a=>({factId:a.factId,sourceFile:a.sourceFile,sourceRef:a.sourceRef,temporalConstraint:a.temporalConstraint}))}}},41240:(a,b,c)=>{c.d(b,{E6:()=>f,Zw:()=>e});var d=c(76875);let e=["task","organization","labor","equipment","materials","schedule","deployment"];function f(a,b,c,g={}){let h=b.find(a=>a.id===c),i=a.tasks.find(a=>a.taskId===c);if(!h||!i)throw Error("共享工程计划查询不属于当前实际任务");let j=g.view??(/工资|实名|检验|储存|保管|安全管理|应急保障|管理制度/u.test(h.title)?"organization":h.contentTypes.includes("schedule")||/工期|进度|网络计划/u.test(h.title)?"schedule":/劳动力|工种|班组配置/u.test(h.title)?"labor":/机械|机具|设备配置/u.test(h.title)?"equipment":/材料|物资/u.test(h.title)?"materials":/部署|总体安排|组织安排/u.test(h.title)?"deployment":"task");if(!e.includes(j))throw Error("共享工程计划查询视图无效");if(g.activityIds&&(!Array.isArray(g.activityIds)||!g.activityIds.length||g.activityIds.some(b=>!a.production.activities.some(a=>a.input.id===b))))throw Error("须使用共享计划目录中的真实活动身份");let k=a.production.activities.filter(b=>g.activityIds?g.activityIds.includes(b.input.id):"task"!==j||b.input.taskIndices.some(b=>a.tasks[b]?.taskId===c)),l=new Set(k.map(a=>a.input.id)),m=a.production.plannedResources.filter(a=>l.has(a.activityId)),n=[],o=new Map,p=(0,d.wp)(a.production,b.map(a=>a.id)).filter(a=>(!a.activityId||l.has(a.activityId))&&("task"===j||"organization"===j||"materials"===j?"task"===j:"window"===a.purpose||"organization"===a.purpose||a.purpose===j||"deployment"===j&&!a.activityId)).map(({taskIds:a,inputMemberIds:b,objectScope:c,basis:d,...e})=>{let f=o.get(d);return f||(f=`basis-${n.length}`,o.set(d,f),n.push({id:f,text:d})),{...e,basisId:f,...!e.activityId?{objectScope:c}:{}}}),q=k.map(a=>{if("task"===j)return a;let{input:b,status:c,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,critical:i,floatDays:k}=a,l={id:b.id,phaseId:b.phaseId,objectScope:b.objectScope,workfront:b.workfront,status:c};return"organization"===j||"materials"===j?l:{...l,predecessors:b.predecessors,startDay:d,endDay:e,startDate:f,endDate:g,durationDays:h,critical:i,floatDays:k}}),r=m.map(a=>{let{activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f}=a,g={activityId:b,phaseId:c,objectScope:d,workfront:e,basis:f};return"task"===j?a:"organization"===j||"materials"===j?{...g,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}:"labor"===j?{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,workers:a.workers,countMeaning:"每日配置含不同轮班人员,非同时在岗峰值"}:"equipment"===j?{...g,crewId:a.crewId,crews:a.crews,equipment:a.equipment}:{...g,crewId:a.crewId,crews:a.crews,shiftsPerDay:a.shiftsPerDay,trades:a.workers.map(a=>a.trade),equipment:a.equipment.map(({name:a,spec:b})=>({name:a,spec:b}))}});return{id:a.id,contractId:a.contractId,projectSnapshotId:a.projectSnapshotId,view:j,scope:{taskId:c,activityIds:[...l],completeSelectedView:!0},task:i,phases:a.phases,activityDirectory:a.production.activities.map(({input:a})=>({id:a.id,phaseId:a.phaseId,objectScope:a.objectScope,workfront:a.workfront})),activities:q,plannedResources:r,numbers:p,bases:n,numberMeaning:"index指向同源完整数记录;活动对象见activityId对应活动,basisId见bases原文。对象与依据只存一份,不裁字;组织管理视图不要求数量。",..."schedule"===j||"deployment"===j||"task"===j?{calendar:a.production.calendar}:{},..."labor"===j?{labor:a.production.labor}:{},..."equipment"===j?{equipment:a.production.equipment}:{},..."materials"===j?{materials:a.production.materials.filter(a=>l.has(a.activityId)),materialStatus:"逐源用途记录,不等于已采用采购总量"}:{},issues:a.production.issues.filter(a=>!a.activityId||l.has(a.activityId)),interfaces:a.tasks.filter(a=>a.taskId!==c&&a.phaseIds.some(a=>i.phaseIds.includes(a))).map(({taskId:a,objectScope:b,boundary:c,handoffs:d})=>({taskId:a,objectScope:b,boundary:c,handoffs:d}))}}},42948:(a,b,c)=>{c.d(b,{Fr:()=>k,HM:()=>l,Hf:()=>n,tv:()=>m,wE:()=>o,yW:()=>p});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598);let i=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u,j=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;function k(a,b){return b?`run:${b}:${a}`:a}function l(a,b,c){if(!j.test(b))throw Error("非法运行资产文件名");if(void 0!==c&&!i.test(c))throw Error("非法运行 ID");return c?g().join(a,"runs",c,"artifacts",b):g().join(a,"assets",b)}function m(a,b,c,d){let f=l(a,b,d),i=JSON.stringify(c);if(void 0===i)throw Error("运行资产不能是 undefined");e().mkdirSync(g().dirname(f),{recursive:!0});let j=`${f}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(j,i,{encoding:"utf8",flag:"wx"});try{if(d)try{e().linkSync(j,f)}catch(a){if("EEXIST"!==a.code)throw a;if(e().readFileSync(f,"utf8")!==i)throw Error(`运行资产已存在且内容不同:${d}/${b}`,{cause:a})}else e().renameSync(j,f)}finally{e().rmSync(j,{force:!0})}return{assetPath:f,bytes:Buffer.byteLength(i),sha256:(0,h.createHash)("sha256").update(i).digest("hex")}}function n(a){if(!a.runId)throw Error("实时模型进度必须绑定当前运行 ID");let b=l(a.generatedDir,"llm-live-progress.json",a.runId),c=JSON.stringify({...a.snapshot,version:1,runId:a.runId,documentId:a.documentId});e().mkdirSync(g().dirname(b),{recursive:!0});let d=`${b}.${(0,h.randomUUID)()}.tmp`;e().writeFileSync(d,c,{encoding:"utf8",flag:"wx"});try{e().renameSync(d,b)}finally{e().rmSync(d,{force:!0})}}function o(a,b){return b?[["run-start","run-start.json","本轮启动身份"],["run-inputs","run-inputs.json","本轮已准备输入快照"],["project-model","project-model.json","本轮写作与终检共用的项目事实快照"],["tender-requirements","tender-requirements.json","本轮原始招标条款、技术职责拆分、商务归宿及未裁决台账"],["document-contract","document-contract.json","本轮写作前冻结的职责、义务与七维评价合同"],["contract-ownership-plan","contract-ownership-plan.json","主控逐项确认事实、表格与交付义务的唯一主要责任小节"],["content-type-plan","content-type-plan.json","本轮主控对各节具体内容职责与适用类型的确认回执"],["contract-quality","contract-quality.json","本轮固定合同、项目快照和正文版本的七维评价回执"],["writing-task-hierarchy","writing-task-hierarchy.json","锁定交付小节与专业作者子任务之间的固定层级"],["chapter-writing-structures","chapter-writing-structures.json","本轮作者任务开始前的固定结构和内容职责"],["author-task-executions","author-task-executions.json","实际作者实例、委派任务、完整输入身份、执行终态与共用章节预算"],["author-accounting-final","author-accounting-final.json","同一合同跨续跑累计的调用、token、成本与章节预算消耗"],["author-candidates","author-candidates.json","本轮工具执行、自检、清理及重试前的原始模型返回索引"],["document-token-anomaly","document-token-anomaly.json","本轮无有效进展的重复模型消费与整份暂停回执;缺usage和供应商结算保持未知"],["document-model-final","document-model-final.json","本轮统一文档模型的最终版本与全部累计修改记录"],["contract-quality-c0","contract-quality-c0.json","固定首稿的完整七维评价,后续修改不能覆盖"],["contract-light-repair","contract-light-repair.json","统一预算内轻修的预检、提交结果与首稿通过读数"],["document-model-author","document-model-author.json","本轮固定任务的结构化作者模型、初始候选与累计修改账"],["blueprint","blueprint.json","本轮写作蓝图"],["requirement-assignments","requirement-assignments.json","本轮要求责任分配"],["structure-assignments","structure-assignments.json","本轮呈现要求分配"],["before-global-review","before-global-review.json","全文审查前章节快照(含章内重试,不等于原始首稿)"],["before-finalize","before-finalize.json","收口前章节快照"],["final-document","final-document.json","本轮最终内容快照"],["run-summary","run-summary.json","本轮阶段墙钟、调用用途与历史评分读数"]].flatMap(([c,d,f])=>{let g=l(a,d,b);if(!e().existsSync(g))return[];let i=(0,h.createHash)("sha256").update(e().readFileSync(g)).digest("hex");return[{id:k(c,b),artifactKind:c,type:"file",role:"attachment",path:g,sha256:i,runId:b,status:"generated",message:f}]}):[]}function p(a){if(!a.runId)return;let b=a.chapters.map(a=>({id:a.id,title:a.title,content:a.content,contentHash:(0,h.createHash)("sha256").update(a.content).digest("hex")}));m(a.generatedDir,`${a.stage}.json`,{version:1,runId:a.runId,documentId:a.documentId??null,stage:a.stage,capturedAt:Date.now(),chapters:b,...void 0!==a.markdown?{markdown:a.markdown}:{},rawFirstCandidate:!1},a.runId)}},43255:(a,b,c)=>{c.d(b,{X4:()=>j,Yn:()=>i});var d=c(77598),e=c(16646),f=c(55422);function g(a,b){let c=a.trim();if(/^其他$|^其他工程$/u.test(c)){let a=b.map(a=>a.name);return a.some(a=>/彩绘|护栏|围栏|小品|标识|标牌|墙面|整治/u.test(a))?"环境整治工程":a.some(a=>/绿化|栽植|铺装|种植/u.test(a))?"景观附属工程":a.some(a=>/拆除|清理|清淤|清运/u.test(a))?"清理整治工程":"零星工程"}return/^其他装饰/u.test(c)?"零星装饰工程":/^措施项目$/u.test(c)?b.map(a=>a.name).some(a=>/化粪池|吊装|安装/u.test(a))?"模板、脚手架及化粪池安装工程":"模板与脚手架工程":/墙[、,]?柱面装饰/u.test(c)?b.some(a=>/幕墙|隔断/u.test(a.name))?c:"墙柱面装饰工程":c}function h(a,b,c=!1){let d=new Map;for(let b of a.entries){if(!b.section)continue;let a=c?JSON.stringify([b.sourceFile,b.villageGroup,b.section]):b.section,e=d.get(a)||[];e.push(b),d.set(a,e)}let e=[],f=0;for(let a of d.values()){let c=g(a[0].section,a),d=a.some(a=>"unit-project"===a.sectionKind),h=[];if(d){let b=new Map;for(let d of a){let a=d.subsection||c,e=b.get(a)||[];e.push(d),b.set(a,e)}for(let[a,c]of b)h.push(k(g(a,c),c))}else h.push(k(c,a));f+=1,e.push({id:`${b}.${f}`,title:c,requiredParams:h.flatMap(a=>Object.keys(a.quantities).slice(0,5).map(a=>({path:`data.quantities.${a}`,mode:"must_cite",strict:!0}))),tablePlans:[],workPackages:h})}return e}function i(a){let{chapterTitles:b,boq:c}=a,d=b.map((b,d)=>{var e;let f=String(d+1),g=/主要分部分项|施工方案|施工方法/u.test(b)?h(c,f):[];return{id:f,title:b,isActive:(e=a.docType,!(/专项施工方案|专项方案|危大/u.test(e)&&/总平面|平面布置|施工部署|总体部署/u.test(b))),requiredParams:[],subSections:g}}),e=h(c,"project",!0).flatMap(a=>a.workPackages),f=c.entries.filter(a=>!a.section);return f.length&&e.push(k("未分部清单记录",f)),{chapters:d,projectWorkPackages:e}}function j(a){return(0,d.createHash)("sha256").update(JSON.stringify([a.sourceFile,a.villageGroup,a.section,a.subsection,a.seq,a.code,a.name,a.description,a.unit,a.quantity,a.chunkIndex])).digest("hex")}function k(a,b){let c=[...b].sort((a,b)=>a.seq-b.seq),d={},g=new Map;for(let a of c){if(!a.name)continue;let b=g.get(a.name)??new Map;b.set(a.unit,(b.get(a.unit)??0)+a.quantity),g.set(a.name,b)}for(let[a,b]of g)for(let[c,e]of b)d[b.size>1?`${a}(${c||"未注明单位"})`:a]={value:Math.round(1e3*e)/1e3,unit:c};let h=[...new Set(c.map(a=>a.name).filter(Boolean))],i=(0,f.lh)(c),k=[],l=new Set;for(let a of c){for(let b of(0,f.QU)(a.description)){let a=`${b.key}=${b.value}`;if(!l.has(a)&&(l.add(a),k.push({key:b.key,value:b.value,source:"boq"}),k.length>=24))break}if(k.length>=24)break}let m=[];for(let a of c)for(let b of(0,f.QU)(a.description))/压实|试验|检测|验收|闭水|合格/u.test(`${b.key}${b.value}`)&&m.length<12&&!m.includes(b.value)&&m.push(b.value);let n=(0,e.cn)(c.map(a=>a.name)),o=[];for(let a of(0===m.length&&n.length>0&&m.push(...n[0].acceptance.slice(0,6).map(a=>`${a}(知识卡)`)),n.slice(0,2)))for(let b of a.standards)o.includes(b)||o.push(b);return{name:a,kind:"major",quantities:d,objectNames:h,methods:i,params:k,acceptance:m,standards:o,source:"boq",coveredSeqs:c.map(a=>a.seq),members:c.map(a=>({id:j(a),entry:{...a}}))}}},43967:(a,b,c)=>{c.d(b,{b:()=>g,jF:()=>h});let d=globalThis,e=d.__customizeStorageMaintenance??={active:!1};d.__customizeStorageApiWriters??=new Set;class f extends Error{constructor(){super("系统清空正在执行,暂不接收新的存储访问"),this.name="StorageMaintenanceError"}}function g(){return e.active}function h(){if(e.active)throw new f}},44616:(a,b,c)=>{c.d(b,{bV:()=>f,lu:()=>h,mk:()=>g});var d=c(63327);let e=new WeakMap;function f(a){let b=e.get(a);if(!b){let c=[...a.facts,...a.sourceControls??[]],f=[...new Set(c.filter(a=>"verified-source-excerpt"!==a.roleId).map(d.vg))].sort(),g=[...new Set(c.filter(a=>"verified-source-excerpt"===a.roleId).map(d.vg))].sort();b={facts:f,sources:g,factIndices:new Map(f.map((a,b)=>[a,b])),sourceIndices:new Map(g.map((a,b)=>[a,b]))},e.set(a,b)}return b}function g(a,b,c){let d=f(a);return{...b&&d.factIndices.has(b)?{factIndex:d.factIndices.get(b)}:{},...c&&d.sourceIndices.has(c)?{sourceIndex:d.sourceIndices.get(c)}:{}}}function h(a,b,c){let d="fact"===b?f(a).facts:f(a).sources;if(!Number.isSafeInteger(c)||0>Number(c)||Number(c)>=d.length)throw Error(`${"fact"===b?"属性":"原文"}引用序号不属于当前冻结项目`);return d[Number(c)]}},44736:(a,b,c)=>{c.d(b,{FP:()=>q,H0:()=>k,U2:()=>j,_e:()=>z,eb:()=>A,fN:()=>m,hg:()=>l,oN:()=>r});var d=c(77598),e=c(19898),f=c(70247);let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(a)).digest("hex"),h=a=>{let{rowSha256:b,...c}=a;return b===g(c)},i=a=>a.replace(/\s/gu,"");function j(a){let b=a.trim();if(!b.startsWith("|")||!b.endsWith("|"))return;let c=[],d="",e=!1;for(let a=1;a<b.length-1;a++){let f=b[a];"|"!==f||e?d+=f:(c.push(d.trim()),d=""),e="\\"===f&&!e}return c.push(d.trim()),c.length>=2?c:void 0}function k(a){let b=a[0]?.trim()??"";return/^(?:\d{1,3}(?:[..]\d{1,3}){1,4}|第[零一二三四五六七八九十百千\d]+[条款项])$/u.test(b)?b:void 0}function l(a,b,c){let{sha256:d,...f}=a;if("tender-native-file-proof-v1"!==a.version||a.file!==b||a.sourceChunkCount!==c||a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||!/^[a-f0-9]{64}$/u.test(a.sourceSha256)||!/^[a-f0-9]{64}$/u.test(a.metadataSha256)||d!==g(f))throw Error("原生PDF表格文件证据身份不一致");return a.pages.flatMap(c=>{if(c.glyphSha256!==g(c.glyphs))throw Error("原生PDF字形回执不属于实际文件");if("fallback"===c.strategy)return[];if("ruled-cells"!==c.strategy)throw Error("原生PDF页面没有明确layout策略");let d=new Map(c.glyphs.map(a=>[a.id,a])),e=new Map,f=new Map;for(let a of c.cells){if(!Number.isSafeInteger(a.columnIndex)||a.columnIndex<0||!Number.isSafeInteger(a.columnSpan)||a.columnSpan<1||4!==a.bounds.length||!a.bounds.every(Number.isFinite)||a.bounds[0]>=a.bounds[2]||a.bounds[1]>=a.bounds[3])throw Error("原生表格物理合并单元格身份无效");for(let[b,c]of[[a.columnIndex,a.bounds[0]],[a.columnIndex+a.columnSpan,a.bounds[2]]]){let a=f.get(b);if(void 0!==a&&Math.abs(a-c)>1.5)throw Error("原生表格逻辑列与物理边界不一致");f.set(b,c)}let b=`${a.bounds[1]}:${a.bounds[3]}`;e.set(b,[...e.get(b)??[],a])}let h=[...e.values()].sort((a,b)=>b[0].bounds[3]-a[0].bounds[3]),i=Math.max(...c.cells.map(a=>a.columnIndex+a.columnSpan)),j=h.map(a=>{let b=Array(i).fill(""),c=0,e;for(let f of a.sort((a,b)=>a.columnIndex-b.columnIndex)){if(f.columnIndex!==c||void 0!==e&&Math.abs(f.bounds[0]-e)>1.5)throw Error("原生表格列范围重叠或缺失");c+=f.columnSpan,e=f.bounds[2],b[f.columnIndex]=f.glyphIds.map(a=>{let b=d.get(a);if(!b)throw Error("原生表格字形ID缺失");return b}).sort((a,b)=>2>=Math.abs(a.y-b.y)?a.x-b.x:b.y-a.y).map(a=>a.str).join("").replace(/\|/gu,"\\|")}if(c!==i)throw Error("原生表格列范围不完整");return b}),k=j[0]??[];return j.map((d,e)=>{let f={file:b,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:c.page,row:e,rowCount:j.length,cells:d,bounds:h[e].map(a=>a.bounds),physicalCells:h[e],headers:k};return{...f,rowSha256:g(f)}})})}function m(a,b,c){let d=a.filter(a=>(void 0===c||a.page===c)&&a.cells.length===b.length&&a.cells.every((a,c)=>i(a)===i(b[c])));return 1===d.length?d[0]:void 0}let n=(a,b)=>{let c=j(b.rawText);return b.file===a.file&&!!c&&c.length===a.cells.length&&c.every((b,c)=>i(b)===i(a.cells[c]))},o=a=>(0,f.y)(a.map(({sourceGapBefore:a,sourceTableBridgeBefore:b,sourceNativeTextBridgeBefore:c,...d})=>d));function p(a,b){return h(a)&&h(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.row===a.rowCount-1&&1===b.row&&a.cells.length===b.cells.length&&a.cells.length>=2&&a.bounds.length===a.cells.length&&b.bounds.length===b.cells.length&&a.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&b.physicalCells.every((a,b)=>a.columnIndex===b&&1===a.columnSpan)&&a.headers.length===b.headers.length&&a.headers.every((a,c)=>i(a)===i(b.headers[c]))&&a.bounds.every((a,c)=>1.5>Math.abs(a[0]-b.bounds[c][0])&&1.5>Math.abs(a[2]-b.bounds[c][2]))&&b.cells.slice(0,-1).every(a=>!i(a))&&!!i(b.cells.at(-1)??"")&&!!i(a.cells.at(-1)??"")&&!/[。!?!?;;][))】」》”’"']*$/u.test(a.cells.at(-1).trim())}function q(a,b,c,d){let{witnessSha256:e,...f}=a,h=d.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),i=d.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]),j=1===h.length&&1===i.length&&i[0]>=h[0]?d.slice(h[0],i[0]+1):[];if(!b||"native-table-page-bridge-v2"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!p(a.from,a.to)||!j[0]||!j.at(-1)||!n(a.from,j[0])||!n(a.to,j.at(-1))||a.spansSha256!==o(j)||!j.includes(b)||!j.includes(c)||!a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start))throw Error("原生表格续行与完整layout/source spans证据不一致")}function r(a,b){let c=[...a];for(let a=0;a<c.length;a++){let d,e=c[a]?.nativeTableRow;if(!e)continue;let h=c.findIndex((b,c)=>c>a&&!!b.nativeTableRow&&0!==b.nativeTableRow.row&&b.file===e.file);if(h<0)continue;let k=c[h].nativeTableRow;if(!p(e,k)||c.slice(a+1,h).some(a=>a.nativeTableRow&&(0!==a.nativeTableRow.row||a.nativeTableRow.page!==k.page||a.nativeTableRow.nativeProofSha256!==e.nativeProofSha256)))continue;let l=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b);return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||c.every((a,b)=>i(a)===i(k.headers[b]??"")))});if(c.slice(a+1,h).some(a=>!l(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text)))continue;let m=c[a],q=c[h],r=m.sourceSpans?.at(-1),s=q.sourceSpans?.[0];if(!r||!s||void 0===r.chunkIndex||void 0===s.chunkIndex)continue;let t=b.filter(a=>a.file===e.file&&a.chunkIndex>r.chunkIndex&&a.chunkIndex<s.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(t.length!==s.chunkIndex-r.chunkIndex-1)continue;let u=b.find(a=>a.file===e.file&&a.chunkIndex===r.chunkIndex),v=b.find(a=>a.file===e.file&&a.chunkIndex===s.chunkIndex);if(!u||!v)continue;let w=[{chunk:u,start:r.end,end:u.text.length},...t.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:v,start:0,end:s.start}];if(w.some(a=>!l(a.chunk.text.slice(a.start,a.end))))continue;let x=[r,...w.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:e.file,chunkIndex:a.chunkIndex,section:"PDF表格页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),...q.sourceSpans];try{d=function(a,b,c){if(!p(a,b)||!c[0]||!c.at(-1)||!n(a,c[0])||!n(b,c.at(-1)))throw Error("没有相邻页同表同列续行证据");let d=[];for(let a=1;a<c.length;a++){let b=c[a-1],e=c[a];if(b.chunkIndex!==e.chunkIndex){if(void 0===b.chunkIndex||e.chunkIndex!==b.chunkIndex+1)throw Error("表格续行不能跳过未保全的parse chunk");d.push({fromChunkIndex:b.chunkIndex,toChunkIndex:e.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:e.chunkSha256,fromEnd:b.end,toStart:e.start})}}let e={version:"native-table-page-bridge-v2",file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.nativeProofSha256,from:a,to:b,fromSpanSha256:o([c[0]]),toSpanSha256:o([c.at(-1)]),spansSha256:o(c),transitions:d};return{...e,witnessSha256:g(e)}}(e,k,x)}catch{continue}let y=[...m.sourceSpans,...x.slice(1).map((a,b)=>a.chunkIndex!==x[b].chunkIndex?{...a,sourceTableBridgeBefore:d}:a)];c.splice(a,h-a+1,{...m,text:y.map(a=>a.text).join("\n"),nativeTableRow:k,sourceSpans:y,sourceSpansSha256:(0,f.y)(y)}),a--}return c}let s=a=>/^-?\d{1,4}-?$/u.test(i(a)),t=a=>{let{lineSha256:b,...c}=a;return b===g(c)};function u(a){let{sha256:b,...c}=a;if(a.nativeLayoutVersion!==e.PDF_NATIVE_LAYOUT_VERSION||b!==g(c))throw Error("原生普通页文件证据身份不一致");return a.pages.flatMap(b=>{if(b.glyphSha256!==g(b.glyphs))throw Error("原生普通页glyph指纹不一致");let c=[];for(let a of[...b.glyphs].filter(a=>a.str.trim()).sort((a,b)=>b.y-a.y||a.x-b.x)){let b=c.find(b=>Math.abs(b.y-a.y)<=Math.max(2,.45*a.height));b?b.glyphs.push(a):c.push({y:a.y,glyphs:[a]})}return c.map((d,e)=>{d.glyphs.sort((a,b)=>a.x-b.x);let f=d.glyphs.filter(a=>/[A-Za-z\p{Script=Han}]/u.test(a.str)),h={file:a.file,sourceSha256:a.sourceSha256,nativeProofSha256:a.sha256,page:b.page,pageGlyphSha256:b.glyphSha256,line:e,lineCount:c.length,text:d.glyphs.map(a=>a.str).join("").replace(/\|/gu,"\\|"),glyphIds:d.glyphs.map(a=>a.id),x:d.glyphs[0].x,xEnd:Math.max(...d.glyphs.map(a=>a.x+a.width)),y:d.y,height:Math.max(...d.glyphs.map(a=>a.height)),columnGap:d.glyphs.some((a,b)=>b>0&&a.x-d.glyphs[b-1].x-d.glyphs[b-1].width>2*Math.max(a.height,d.glyphs[b-1].height)),fontNames:[...new Set((f.length?f:d.glyphs).flatMap(a=>a.fontName?[a.fontName]:[]))].sort()};return{...h,lineSha256:g(h)}})})}let v=(a,b,c)=>{let d=(a=>{let b=j(a.rawText);if(b){if(!b.slice(0,-1).every(a=>!i(a)))return;return b.at(-1)}return a.rawText.trim().replace(/^#{1,6}\s+/u,"")})(b);if(b.file!==a.file||void 0===d)return!1;let e=i(d),f=i(a.text);return!!f&&("start"===c?e.startsWith(f):e.endsWith(f))};function w(a,b){let c=a[0],d=b[0];return c&&d&&i(c.text)===i(d.text)&&1.5>Math.abs(c.x-d.x)&&1.5>Math.abs(c.y-d.y)&&1.5>Math.abs(c.height-d.height)&&c.fontNames.join("|")===d.fontNames.join("|")?i(c.text):void 0}function x(a,b,c,d,e){let f,g=w(c,d),j=c.filter(a=>!s(a.text)&&i(a.text)!==g),k=d.filter(a=>!s(a.text)&&i(a.text)!==g),l=1.5>Math.abs(a.xEnd-b.xEnd)&&a.x>b.x&&j.some(c=>c.line<a.line&&1.5>Math.abs(c.x-b.x)&&c.fontNames.join("|")===b.fontNames.join("|")),m=1.5>Math.abs(a.x-b.x)||l,n=!!e&&h(e)&&e.file===b.file&&e.sourceSha256===b.sourceSha256&&e.nativeProofSha256===b.nativeProofSha256&&e.page===b.page&&1===e.row&&e.cells.slice(0,-1).every(a=>!i(a))&&i(e.cells.at(-1)??"").startsWith(i(b.text));return t(a)&&t(b)&&a.file===b.file&&a.sourceSha256===b.sourceSha256&&a.nativeProofSha256===b.nativeProofSha256&&b.page===a.page+1&&a.line===j.at(-1)?.line&&b.line===k[0]?.line&&m&&2>Math.abs(a.height-b.height)&&!a.columnGap&&!b.columnGap&&(n||l||!j.some(a=>a.columnGap)&&!k.some(a=>a.columnGap))&&a.fontNames.join("|")===b.fontNames.join("|")&&(f=b.text,!/^(?:第[零一二三四五六七八九十百\d]+[章条节]|[((]?[一二三四五六七八九十百\d]+[))]|[一二三四五六七八九十百\d]+[..、])/u.test(f.trim()))&&!!i(a.text)&&!!i(b.text)&&!/[。!?!?;;::][))】」》”’"']*$/u.test(a.text.trim())}function y(a,b){let c=new Set([...b.fromPageLines,...b.toPageLines].filter(a=>s(a.text)).map(a=>i(a.text)));return a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let d=a.trim(),e=i(d.replace(/^#{1,6}\s+/u,"")),f=/^#{1,6}\s+PDF 第\s*(\d+)\s*页$/u.exec(d),g=j(d);return f?Number(f[1])===b.from.page||Number(f[1])===b.to.page:!!c.has(e)||!!b.repeatedHeader&&e===b.repeatedHeader||!!b.toGridRow&&(/^#{1,6}\s+PDF 原生网格表格区域$/u.test(d)||"|"===d||!!g&&g.length===b.toGridRow.cells.length&&(g.every(a=>/^:?-{3,}:?$/u.test(a))||g.every((a,b)=>a===`列${b+1}`)||g.every((a,c)=>i(a)===i(b.toGridRow.headers[c]??""))))})}function z(a,b,c,d){let{witnessSha256:e,...f}=a,h=function(a,b){let c=b.flatMap((b,c)=>o([b])===a.fromSpanSha256?[c]:[]),d=b.flatMap((b,c)=>o([b])===a.toSpanSha256?[c]:[]);return 1===c.length&&1===d.length&&d[0]>=c[0]?b.slice(c[0],d[0]+1):[]}(a,d);if(!b||"native-text-page-bridge-v1"!==a.version||a.file!==c.file||a.file!==b.file||e!==g(f)||!t(a.from)||!t(a.to)||a.to.page!==a.from.page+1||a.from.file!==a.file||a.to.file!==a.file||!a.fromPageLines.every(t)||!a.toPageLines.every(t)||a.repeatedHeader!==w(a.fromPageLines,a.toPageLines)||!x(a.from,a.to,a.fromPageLines,a.toPageLines,a.toGridRow)||a.from.sourceSha256!==a.sourceSha256||a.to.sourceSha256!==a.sourceSha256||a.from.nativeProofSha256!==a.nativeProofSha256||a.to.nativeProofSha256!==a.nativeProofSha256||!h[0]||!h.at(-1)||!v(a.from,h[0],"end")||!v(a.to,h.at(-1),"start")||a.toGridRow&&!n(a.toGridRow,h.at(-1))||a.spansSha256!==o(h)||!function(a,b,c,d){let e=d.indexOf(b);return!(e<0)&&d[e+1]===c&&void 0!==b.chunkIndex&&void 0!==c.chunkIndex&&!(c.chunkIndex<b.chunkIndex)&&!(c.chunkIndex>b.chunkIndex+1)&&(b.chunkIndex!==c.chunkIndex||b.chunkSha256===c.chunkSha256&&!(b.end>c.start))&&a.transitions.some(a=>a.fromChunkIndex===b.chunkIndex&&a.toChunkIndex===c.chunkIndex&&a.fromChunkSha256===b.chunkSha256&&a.toChunkSha256===c.chunkSha256&&a.fromEnd===b.end&&a.toStart===c.start)}(a,b,c,h)||h[0].chunkIndex===h.at(-1).chunkIndex&&(h.some(a=>a.chunkIndex!==h[0].chunkIndex||a.chunkSha256!==h[0].chunkSha256)||h.slice(1,-1).some(b=>!y(b.rawText,a))))throw Error("原生普通页续行与实际glyph/layout/source spans证据不一致")}function A(a,b,c,d){let e=c.flatMap(u),h=[...a],k=new Map,l=new Map,m=new Map,p=(a,b)=>JSON.stringify([a,b]);for(let a of e){let b=p(a.file,a.page);k.set(b,[...k.get(b)??[],a])}for(let a of[...b].sort((a,b)=>(a.file??"").localeCompare(b.file??"")||(a.chunkIndex??-1)-(b.chunkIndex??-1))){let b=a.file??"",c=[...a.text.matchAll(/^#{1,6}\s+PDF 第\s*(\d+)\s*页/gmu)].map(a=>({start:a.index,page:Number(a[1])}));l.set(p(b,a.chunkIndex),{initial:m.get(b),markers:c}),c.length&&m.set(b,c.at(-1).page)}let q=a=>{let b=l.get(p(a.file,a.chunkIndex));return b?.markers.filter(b=>b.start<a.start).at(-1)?.page??b?.initial},r=(a,b)=>(k.get(p(a.file,q(a)))??[]).filter(c=>v(c,a,b));for(let a=0;a<h.length;a++){let c=h[a],e=c.sourceSpans;if(!e)continue;let l=-1,m;for(let a=e.length-1;a>=0;a--){let b=r(e[a],"end").filter(a=>!s(a.text));if(1===b.length){l=a,m=b[0];break}}if(!m)continue;let t=k.get(p(m.file,m.page))??[],u=k.get(p(m.file,m.page+1))??[],z=w(t,u),A=u.find(a=>!s(a.text)&&i(a.text)!==z);if(!A)continue;let B=h.findIndex((b,c)=>c>a&&b.file===m.file&&b.sourceSpans?.[0]&&v(A,b.sourceSpans[0],"start")&&q(b.sourceSpans[0])===A.page);if(B<0)continue;let C=h[B],D=C.nativeTableRow,E=D&&1===D.row&&D.cells.slice(0,-1).every(a=>!i(a))&&C.sourceSpans?.[0]&&n(D,C.sourceSpans[0])?D:void 0;if(!x(m,A,t,u,E)||!E&&(C.clauseNo||C.sourceSpans?.[0]?.logicalBoundaryBefore||/^[^::,,。;;“”"'()()]{1,40}[::]/u.test(A.text)||d&&!d(c,C)))continue;let F=a=>a.split(/\r?\n/u).filter(a=>a.trim()).every(a=>{let b=a.trim(),c=j(b),d=i(b.replace(/^#{1,6}\s+/u,""));return/^#{1,6}\s+(?:PDF 第\s*\d+\s*页|PDF 原生网格表格区域|-?\d+-?)$/u.test(b)||s(d)||!!z&&d===z||!!E&&"|"===b||!!c&&(c.every(a=>/^:?-{3,}:?$/u.test(a))||c.every((a,b)=>a===`列${b+1}`)||!!z&&i(c.join(""))===z)});if(h.slice(a+1,B).some(a=>!F(a.sourceSpans?.map(a=>a.rawText).join("\n")??a.text))||e.slice(l+1).some(a=>!F(a.rawText)))continue;let G=h[B],H=G.sourceSpans?.[0],I=e.at(-1);if(!H||!I||void 0===H.chunkIndex||void 0===I.chunkIndex||H.chunkIndex<I.chunkIndex)continue;let J=b.filter(a=>a.file===m.file&&a.chunkIndex>I.chunkIndex&&a.chunkIndex<H.chunkIndex).sort((a,b)=>a.chunkIndex-b.chunkIndex);if(J.length!==Math.max(0,H.chunkIndex-I.chunkIndex-1))continue;let K=b.find(a=>a.file===m.file&&a.chunkIndex===I.chunkIndex),L=b.find(a=>a.file===m.file&&a.chunkIndex===H.chunkIndex);if(!K||!L)continue;let M=I.chunkIndex===H.chunkIndex?[{chunk:K,start:I.end,end:H.start}]:[{chunk:K,start:I.end,end:K.text.length},...J.map(a=>({chunk:a,start:0,end:a.text.length})),{chunk:L,start:0,end:H.start}];if(M.some(a=>a.end<a.start||!F(a.chunk.text.slice(a.start,a.end))))continue;let N=M.filter(a=>a.chunk.text.slice(a.start,a.end).trim()).map(({chunk:a,start:b,end:c})=>({file:m.file,chunkIndex:a.chunkIndex,section:"PDF普通页间原始布局",chunkSha256:a.sha256,sourceStartChar:a.startChar,sourceEndChar:a.endChar,start:b,end:c,rawText:a.text.slice(b,c),text:a.text.slice(b,c)})),O=[...e.slice(l),...N,H],P=[],Q=!0,R=I.chunkIndex===H.chunkIndex;for(let a=1;a<O.length;a++){let b=O[a-1],c=O[a];if(b.chunkIndex!==c.chunkIndex||R){if(void 0===b.chunkIndex||void 0===c.chunkIndex||c.chunkIndex<b.chunkIndex||c.chunkIndex>b.chunkIndex+1||b.chunkIndex===c.chunkIndex&&(b.chunkSha256!==c.chunkSha256||b.end>c.start)){Q=!1;break}P.push({fromChunkIndex:b.chunkIndex,toChunkIndex:c.chunkIndex,fromChunkSha256:b.chunkSha256,toChunkSha256:c.chunkSha256,fromEnd:b.end,toStart:c.start})}}if(!Q)continue;let S={version:"native-text-page-bridge-v1",file:m.file,sourceSha256:m.sourceSha256,nativeProofSha256:m.nativeProofSha256,from:m,to:A,fromPageLines:t,toPageLines:u,...E?{toGridRow:E}:{},...z?{repeatedHeader:z}:{},fromSpanSha256:o([O[0]]),toSpanSha256:o([O.at(-1)]),spansSha256:o(O),transitions:P},T={...S,witnessSha256:g(S)};if(R&&O.slice(1,-1).some(a=>!y(a.rawText,T)))continue;let U=[...N,H],V=[...e,...U.map((a,b)=>R||a.chunkIndex!==(b?U[b-1]:I).chunkIndex?{...a,sourceNativeTextBridgeBefore:T}:a),...G.sourceSpans.slice(1)];h.splice(a,B-a+1,{...c,text:V.map(a=>a.text).join("\n"),sourceSpans:V,sourceSpansSha256:(0,f.y)(V)}),a--}return h}},45455:(a,b,c)=>{c.d(b,{Bj:()=>j,xj:()=>i});var d=c(77598);let e=new Set(["decisionId","requestId","toolCallId","capturedAt","recordedAt","startedAt","endedAt","finishedAt","elapsedMs","durMs","queryTimeMs"]);function f(a){return Array.isArray(a)?a.map(f):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>!e.has(a)).sort(([a],[b])=>a.localeCompare(b)).map(([a,b])=>[a,f(b)])):a}let g=a=>(0,d.createHash)("sha256").update(JSON.stringify(f(a))).digest("hex"),h=a=>a&&"object"==typeof a&&!Array.isArray(a)?a:void 0;function i(a){return a.flatMap(a=>{let b=h(a.data);if(!a.ok||!b)return[];if("ask_chief"===a.toolName){if("model"!==b.source)return[];let a=Object.fromEntries(("use-facts"===b.action?["factIds"]:"use-sources"===b.action?["sourceIds"]:"engineering-controls"===b.action?["controls","writingControls"]:"qualitative-controls"===b.action?["qualitativeControls"]:[]).filter(a=>Array.isArray(b[a])&&b[a].length>0).map(a=>[a,b[a]]));return Object.keys(a).length?[g(["chief-decision",b.taskId,b.action,a])]:[]}let c=Object.fromEntries(("query_construction_plan"===a.toolName?["activities","plannedResources","numbers","materials"]:"query_project_facts"===a.toolName?["candidates","sourceEvidence"]:"query_cad_context"===a.toolName?["records"]:"query_source_units"===a.toolName?["units"]:"read_source"===a.toolName?["chunks"]:["search_evidence","query_work_packages","discover_files"].includes(a.toolName)?["items"]:"list_skills"===a.toolName?["skills"]:"match_skills"===a.toolName?["matched"]:[]).flatMap(c=>{if(!Array.isArray(b[c]))return[];let d=b[c].filter(b=>{let c=h(f(b));return!!c&&!!Object.keys(c).length&&("read_source"!==a.toolName&&"search_evidence"!==a.toolName||"string"==typeof c.content&&!!c.content.trim())}),e="search_evidence"===a.toolName?d.map(a=>Object.fromEntries(Object.entries(h(a)).filter(([a])=>!["score","rank","retrievalRank","retrievalScore"].includes(a)))):d;return e.length?[[c,e]]:[]}));"load_skill"===a.toolName&&h(b.skill)&&(c.skill=b.skill);let d=Object.fromEntries(["snapshotId","projectSnapshotId","contractId",..."query_construction_plan"===a.toolName?["id"]:[],"filePath","relativePath","parsedIdentity","sceneVersion","kind","frameId","rootInstanceId","units","metadata","sourceVersionEligibility"].filter(a=>void 0!==b[a]).map(c=>[c,"metadata"===c&&"read_source"===a.toolName&&h(b[c])?Object.fromEntries(Object.entries(h(b[c])).filter(([a])=>!["mtime","indexedAt"].includes(a))):b[c]])),e=Object.entries(c).flatMap(([c,e])=>(Array.isArray(e)?e:[e]).map(e=>{let f=h(e);if("query_project_facts"===a.toolName&&f?.factId&&"verified-source-excerpt"!==f.roleId)return g(["project-fact",b.snapshotId??b.projectSnapshotId,f.factId,f.value,f.controlContext??null,h(f.sourceVersionEligibility)?.status??null]);if("query_project_facts"===a.toolName&&f&&(f.sourceEvidenceId||"verified-source-excerpt"===f.roleId))return g(["source-excerpt",b.snapshotId??b.projectSnapshotId,f.sourceEvidenceId??f.factId,f.value]);let i="query_construction_plan"===a.toolName&&"numbers"===c&&f?Object.fromEntries(Object.entries(f).filter(([a])=>"basisId"!==a)):e;return g(["source-material",a.toolName,d,c,i])}));return Number.isSafeInteger(b.offset)&&Number.isSafeInteger(b.nextOffset)&&Number(b.nextOffset)>Number(b.offset)&&e.push(g(["source-cursor",a.toolName,d,{offset:b.offset,nextOffset:b.nextOffset}])),e})}async function j(a){let b,{budget:c}=a,e=[...a.initialMessages],f=0,h=0,j="模型未产出可用正文",k="turns-exhausted",l=new Set(i(a.initialEvidence??[])),m=new Set,n=0;for(let o=1;void 0===c.maxTurnsPerBlock||o<=c.maxTurnsPerBlock;o+=1){if(void 0!==c.maxToolCallsPerBlock&&f>=c.maxToolCallsPerBlock){j=`显式工具调用预算耗尽(${f}/${c.maxToolCallsPerBlock})`,k="tool-budget-exhausted";break}let p=await a.runTurn({system:a.system,messages:e,turn:o,...void 0!==c.maxToolCallsPerBlock?{toolCallLimit:Math.max(0,c.maxToolCallsPerBlock-f)}:{}});if(h=o,f+=p.toolCalls.length,p.refused)return a.onTurn?.({turn:o,residual:b?.residual??0,toolCalls:f,action:"unfixable"}),b?{kind:"unfixable",content:b.content,turn:o,residual:b.residual,toolCalls:f,reason:p.refused.message,issues:[],cause:"budget-refused"}:{kind:"budget_refused",turn:o,reason:p.refused.message,refused:p.refused};let q=i(p.toolResults??[]);p.protocolRecovery?.sentOutputBudget!==null&&p.protocolRecovery?.sentOutputBudget!==void 0&&q.push(g(["protocol-recovery",p.protocolRecovery.sentOutputBudget]));let r=q.some(a=>!l.has(a));q.forEach(a=>l.add(a)),r&&(n=0);let s=p.committed||p.text;if(s?.trim()){let c=await a.check(s),g=c.issues.filter(a=>"error"===a.level||"blocker"===a.severity).length;if(c.degraded.length>0&&!c.executed.length)return a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:s,turn:o,residual:g,toolCalls:f,reason:`自查维度全部降级(${c.degraded.join("、")}),本块未做自查,保留当前草稿`,issues:c.issues,cause:"checks-degraded"};if(0===g&&!c.degraded.length)return a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"commit"}),{kind:"passed",content:s,turn:o,residual:g,toolCalls:f};let h=(0,d.createHash)("sha256").update(JSON.stringify([s,c])).digest("hex"),i=m.has(h);if(m.add(h),(!b||g<b.residual)&&(b={content:s,residual:g}),i&&!r){j="相同候选与裁决重复,未取得新证据或改善",k="no-progress";break}a.onTurn?.({turn:o,residual:g,toolCalls:f,action:"regenerate"}),e=[...e,...p.toolMessages??[],{role:"assistant",content:s},{role:"user",content:function(a,b){let c=a.filter(a=>"error"===a.level||"blocker"===a.severity),d=c.slice(0,12).map((a,b)=>`${b+1}. ${a.detectorId?`[${a.detectorId}] `:""}${a.message}`),e=c.slice(12),f=new Map;for(let a of e){let b=a.detectorId||"(未标注判据)";f.set(b,(f.get(b)||0)+1)}let g=e.length>0?`${e.length} 条未逐条列出,按判据分布:${[...f.entries()].map(([a,b])=>`${a} ${b} 条`).join("、")}`:"";return[...b&&b.band?[`【篇幅】本稿 ${b.draftedChars} 字 / 目标 ${b.band.label}(${b.band.min}~${b.band.max} 字)——`+(b.draftedChars>b.band.max?`超出 ${b.draftedChars-b.band.max} 字:按"替换/合并"收口,**不得**再追加新内容`:b.draftedChars<b.band.min?`还差 ${b.band.min-b.draftedChars} 字:就地补足实质内容(不得灌水、不得复读)`:"落在目标带内,保持篇幅、只修下列问题")]:[],"【自查裁决】本稿未通过判据,下列问题必须修正后重新输出完整本节正文:",...d,g,"修正要求:直接输出修正后的**完整**本节正文(不要只输出改动片段、不要解说改动过程);保留原有事实、数值与结论,不得以删除内容的方式规避问题。"].filter(Boolean).join("\n")}(c.issues,{draftedChars:s.length,...a.lengthBand?{band:a.lengthBand}:{}})}];continue}let t=p.toolMessages??[];if(r)e=[...e,...t];else{let a=++n;if(a>=3){j="相同无进展状态在具体反馈后仍未取得新证据、游标或主控决定",k="no-progress";break}e=[...e,...t,{role:"user",content:1===a?"本轮没有新增可用来源、分页游标或已接受的主控决定。原始工具回执已保留;空结果或失败不证明资料缺失,也不能用改查询词、调用ID或再报缺来冒充进展。请依据已取得的资料换用有实际依据的工具/继续真实nextOffset,或向已接线的主控说明具体对象、已查范围与失败;若仍无法核定,保留真实decisionRequests并提交已能完成的正文,不编造参数或条件。":"再次没有新增证据。立即停止重复取证:把已能完成的正文按协议提交(未决事项写入decisionRequests保留),拟定配置按工程经验带依据给出(正文标“拟定”并登记plannedNumbers);继续同类工具调用不会产生新证据。"}]}void 0!==c.maxTurnsPerBlock&&o>=c.maxTurnsPerBlock&&(j="显式轮次预算耗尽,模型尚未提交正文")}return b?(a.onTurn?.({turn:h,residual:b.residual,toolCalls:f,action:"unfixable"}),{kind:"unfixable",content:b.content,turn:h,residual:b.residual,toolCalls:f,reason:j,issues:[],cause:k}):{kind:"no_content",turn:h,reason:j}}},47262:(a,b,c)=>{function d(a){let b=e()?.semanticFingerprints?.[a];return"string"==typeof b&&/^[a-f0-9]{64}$/u.test(b)?b:void 0}function e(){let a='{"version":1,"sourceFingerprint":"d863db1ff37d0934ebbb671f5c8dc07e5943c77d9b554215ce9e64fd8dc26727","semanticFingerprints":{"projectFacts":"791ce1db131a297d94977a7dbfc04322c6f502d53a1dc42b0a8f5763b9aa3e52","documentGeneration":"d5ca7c23abf9dca65aeff41b30320c68daa85d08d1ac1982f1b6da400d3811dd"},"gitCommit":"7507c09e332fbc3c131d96116fd15e4acbe71320","serverVersion":"4.60.1","sourceFiles":704,"capturedAt":"2026-10-12T12:18:46.917Z"}';if(a)try{let b=JSON.parse(a);if(1!==b.version||!/^[a-f0-9]{64}$/u.test(b.sourceFingerprint??"")||"string"!=typeof b.serverVersion||"number"!=typeof b.sourceFiles||"string"!=typeof b.capturedAt||null!==b.gitCommit&&"string"!=typeof b.gitCommit)return;return b}catch{return}}c.d(b,{C:()=>d,S:()=>e})},48825:(a,b,c)=>{c.d(b,{Jf:()=>j,V2:()=>i,bp:()=>d,wJ:()=>e});let d="professional-writing-guidance-v3-professional-first-draft-2026-10-11",e={building:{fileName:"施工组织设计章节写作分析与编制规范(建筑).docx",sha256:"9313607509897e9a252cdefd671c4c72025d2727411972788bfa61b9835a0ff2",pages:12},municipal:{fileName:"施工组织设计章节写作分析与编制规范(市政).docx",sha256:"8e36d97e7084464ab04776093550e10984d3ac4a2a64ac37d5ca74a13a3ccc82",pages:13},bidWriting:{fileName:"技术标写作指南(合肥AI评标).docx",sha256:"3f36e67531da8ac9ffb1847694403ec4246457e445612767b3a82acf02894d0e"},bidReview:{fileName:"青天大模型AI评标规则考证(2026-10-11).docx",sha256:"de976918a1a0f1486cb07e1c2fd4a72a3b86fa480cbd46353f4c1af372badc69"}},f=["先形成工程对象、工作包、部署、资源及时间的共同推演,再按交付目录组织成文。事实、数量、工作面、部位、班组、节点在各章共用稳定身份,作者不各自编数字。","功能职责不等于固定章节:概况解释条件与影响,部署决定空间和顺序,方法说明实施,质量说明检查,安全说明风险与处置,进度说明时间,平面说明现场组织,移交说明最终闭环。推荐母目录不覆盖招标或用户锁定结构。","工作包数量与方法连通,方法与资源连通,资源与工期迭代校核;材料到货早于使用,检测和必要等待进入转序与时间逻辑。同一机械或班组同期不能在不同工作面重复占用。","施工方法、部署、真正重难点与进度应充分展开;人材机重点算准,管理计划重点完成执行闭环,概况与编制依据保持准确简洁。详略按职责和风险,不按统一字数、参数密度或固定图表数量。","表格按真实数据形态选择:单项目多属性用“信息项—内容”纵向或按属性含义分组;多对象在相同指标下比较、配置或排程时才横向展开。字段宽度应容纳完整对象、控制数值和单位,不能把大量无比较目的的属性铺成十几列单行,或把长范围原文挤进窄格。真实阶段或对象矩阵需要宽表时保留全部字段与对应关系,按职责合理分组,不设置固定列数上限、不强制各章制表,不删表行、数值或对象迎合评价。","项目事实依据与技术规范依据分别治理;前者确定实际工程,后者核验控制与验收。核验规范编号、名称、实施日期、状态、替代及局部废止和对象范围;参考文件列出的编号不等于本次已验证有效。","计算、产能假设和规范查证保留内部审计,正文交付核定的配置与控制结果及必要实施条件,不堆算式和来源说明。引用规范仅限确有技术参数、验收或强制边界需要的地方。","首稿采用专业短句和必要分点:条件决定方法,动作达到可检状态,状态放行下一工序。正文工序名不以箭头串替代实施方法;实际流程图和活动网络保留其关系,图后不逐节点逐连线重复全文。","专业标题说明工程对象、方法或组织职责,不拼接关键词、不照抄内部评审标签。正常技术名称重复不导致丢弃、换名或重写;同项目再次编制仍以实际条件和方案质量为准。","写作指南中的样本统计只提供观察线索,不构成评分算法;图片数、箭头数、元数据软件、标题关键词和入围差值不授予质量或真实性。项目实际要求与专业适用规则优先,不为低频统计删去必要风险和接口。"],g={building:"建筑工程按实际楼栋、楼层、流水段和专业接口组织;地下结构、主体、围护装修、机电与室外的先后和移交要一致。不能把房建通用专业强行加入实际没有的工程。",municipal:"市政按真实路线、桩号、区段和工作面组织,明确起点、推进方向、地下与地上转序;涉及社会交通时,导改、围挡、施工阶段、居民出行与施工车辆路线联动。场内便道与场外交通分开。"},h=[{id:"overview",label:"项目理解",match:/概况|项目理解|整体理解|现场条件|工程清单|专业构成/u,buildingPages:[2],municipalPages:[2],guidance:"给出事实及其对施工组织的影响,按专业呈现必要工程量;不复制设计说明、不提前展开工艺,不以无来源地质、距离或道路数据制造针对性。"},{id:"deployment",label:"总体部署",match:/总体部署|施工部署|流水段|工作面|施工区段|施工顺序/u,buildingPages:[2,3],municipalPages:[2,3],guidance:"明确区段和工作面对应哪些任务及工程量、划分理由、起点、方向、先后与穿插、专业移交条件。后续方法、资源和进度必须能从部署找到组织依据。"},{id:"difficulties",label:"重难点",match:/重难点|重点难点|项目特点|制约因素/u,buildingPages:[3,4],municipalPages:[3,4],guidance:"由真实项目证据辨识制约因素,解释原因和后果,给出技术组织、资源、检查及异常处置;只深写真正核心问题,并在相关方法、质量、安全或工期中闭合。"},{id:"method",label:"施工方法",match:/工艺|工法|施工方法|施工技术|浇筑|开挖|吊装|安装|支模/u,buildingPages:[4,5],municipalPages:[4,5],guidance:"对本节实际承担的分项写清对象和工作量、前提、顺序、步骤、材料机具工种、控制、接口、检查、异常和转序。普通工序可组织可检查,核心工序达到必要技术策划深度;不把施组全文变成专项计算书。"},{id:"materials",label:"材料供应",match:/材料|物资|永久设备|供应|采购|人材机/u,buildingPages:[5],municipalPages:[5],guidance:"数量由实际工程量或可靠换算取得,供应与工作面及使用窗口衔接;长周期构件设备串联确认、采购、到货和安装。区分施工机械与永久设备、产品标准与验收标准;不能可靠换算时不假算。"},{id:"equipment",label:"机械与仪器",match:/机械|机具|检测仪器|人材机|确保机/u,buildingPages:[5,6],municipalPages:[5,6],guidance:"关键机械以工作量、可用作业窗口、实际单机或机组能力核定数量,检查同期占用和转场。检测仪器服务实际检验。运距未知不能虚构运输循环时间;算式留审计,不抄经验台数。"},{id:"labor",label:"劳动力",match:/劳动力|班组|工种|人材机|确保人/u,buildingPages:[6,7],municipalPages:[6],guidance:"以班组、工作面、阶段和工种组织投入,核算工作量、工日和持续时间;峰值由实际同期工种矩阵求得,不能相加各专业独立峰值。配置与特种作业必须符合真实任务。"},{id:"quality",label:"质量控制",match:/质量|检验|检测|隐蔽验收|复试|样板|三检/u,buildingPages:[7],municipalPages:[6,7],guidance:"围绕真实实体写检查对象、指标、方法、适用频次、岗位、记录、不合格处置、复验和销项;合格后才转序。方法章写实施,质量章写核验,避免再抄一遍工艺。"},{id:"safety",label:"风险安全与应急",match:/危大|危险源|风险|安全|应急|专项方案|论证/u,buildingPages:[7,8],municipalPages:[7,8],guidance:"实际作业、实体参数和影响对象支撑风险与危大判定,不能靠关键词。承担现场控制时给出作业条件、停止触发、监测和处置;辨识或审核子任务只承担其边界,完整应急由被委派任务负责。"},{id:"schedule",label:"进度组织",match:/进度|工期|节点|施工计划|施工窗口|确保人|确保机/u,buildingPages:[8,9],municipalPages:[8,9],guidance:"共同任务网络连接工作量、工作面、综合能力、材料到货、必要等待、检测与转序。开始结束和搭接可复核,关键路线由逻辑计算,不将箭头示意当网络计划。进度、正文与资源共用同一时间数据。"},{id:"environment",label:"环境与外部运行",match:/文明|环境|环保|扬尘|噪声|校园秩序|交通|既有|保护/u,buildingPages:[9],municipalPages:[9],guidance:"针对实际居民、校园、生产、交通、水体或既有设施说明影响、控制、检查责任及恢复;地方措施需按属地核验,不无条件复制某城市标准。涉及既有设施先调查再分析保护监测。"},{id:"site-layout",label:"现场空间组织",match:/总平面|平面布置|临时设施|临设|运输路线|便道|便桥/u,buildingPages:[9,10],municipalPages:[9,10],guidance:"按实际场地边界和阶段部署布置物流、堆场、机具、水电排水、消防及出入口,检查真实可通行与转场条件。缺尺寸不编坐标;必要实体决定未完成时由主控解决,不用模糊正文冒充已落地。"},{id:"handover",label:"验收恢复移交",match:/竣工|移交|交付|保修|缺陷责任|退场|恢复/u,buildingPages:[10],municipalPages:[10,11],guidance:"从已施工实体与系统反推检查、调试、整改复验、资料、培训和移交。市政还核对道路、交通、绿化及临设恢复;过程隐蔽验收不重复承担整套竣工移交。"}];function i(a){let b="building"===a||"municipal"===a?g[a]:"工程类型未确认时只使用共同写作原则,不能默认套用市政或房建专业条件。";return`【编制规范萃取 ${d},是写作方法先验,不是项目事实或已核现行标准】
123
123
  ${f.join("\n")}
124
124
  ${b}`}function j(a){let b=h.map(b=>({role:b,score:4*!!b.match.test(a.title)+2*!!b.match.test(a.responsibility)+("method"===b.id&&a.contentTypes.includes("method")?1:0)})).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).map(a=>a.role);return{version:d,source:("building"===a.projectType||"municipal"===a.projectType?e[a.projectType]:void 0)??null,roles:b.map(b=>({id:b.id,label:b.label,pages:"building"===a.projectType?b.buildingPages:"municipal"===a.projectType?b.municipalPages:[],guidance:b.guidance})),omitted:[],text:`${i(a.projectType)}
125
125
  本任务相关功能指引仅在其被委派的职责内采用: